diff options
author | Andreas Kling <kling@serenityos.org> | 2020-02-23 12:07:13 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-02-23 12:27:53 +0100 |
commit | c5d913970ab122cdeaf23aea24e65efa6b425ab0 (patch) | |
tree | 07ef4cb2d039521ec7b1931c707b5196b7ea1628 /Libraries/LibGUI/Widget.h | |
parent | 4ce28c32d1813b043758c0d15d5efc17452c2b77 (diff) | |
download | serenity-c5d913970ab122cdeaf23aea24e65efa6b425ab0.zip |
LibGUI: Remove parent parameter to GUI::Widget constructor
Diffstat (limited to 'Libraries/LibGUI/Widget.h')
-rw-r--r-- | Libraries/LibGUI/Widget.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Libraries/LibGUI/Widget.h b/Libraries/LibGUI/Widget.h index 4cd76ef0fd..3de5ac95da 100644 --- a/Libraries/LibGUI/Widget.h +++ b/Libraries/LibGUI/Widget.h @@ -37,7 +37,7 @@ #define REGISTER_GWIDGET(class_name) \ extern WidgetClassRegistration registration_##class_name; \ - WidgetClassRegistration registration_##class_name(#class_name, [](Widget* parent) { return class_name::construct(parent); }); + WidgetClassRegistration registration_##class_name(#class_name, []() { return class_name::construct(); }); template<> inline bool Core::is<GUI::Widget>(const Core::Object& object) @@ -75,18 +75,18 @@ class WidgetClassRegistration { AK_MAKE_NONCOPYABLE(WidgetClassRegistration) AK_MAKE_NONMOVABLE(WidgetClassRegistration) public: - WidgetClassRegistration(const String& class_name, Function<NonnullRefPtr<Widget>(Widget*)> factory); + WidgetClassRegistration(const String& class_name, Function<NonnullRefPtr<Widget>()> factory); ~WidgetClassRegistration(); String class_name() const { return m_class_name; } - NonnullRefPtr<Widget> construct(Widget* parent) const { return m_factory(parent); } + NonnullRefPtr<Widget> construct() const { return m_factory(); } static void for_each(Function<void(const WidgetClassRegistration&)>); static const WidgetClassRegistration* find(const String& class_name); private: String m_class_name; - Function<NonnullRefPtr<Widget>(Widget*)> m_factory; + Function<NonnullRefPtr<Widget>()> m_factory; }; class Widget : public Core::Object { @@ -259,7 +259,7 @@ public: void set_palette(const Gfx::Palette&); protected: - explicit Widget(Widget* parent = nullptr); + Widget(); virtual void custom_layout() {} virtual void did_change_font() {} |