diff options
-rw-r--r-- | Userland/Libraries/LibGUI/Toolbar.cpp | 3 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/Toolbar.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGUI/Toolbar.cpp b/Userland/Libraries/LibGUI/Toolbar.cpp index 12f9189306..64079bf6c9 100644 --- a/Userland/Libraries/LibGUI/Toolbar.cpp +++ b/Userland/Libraries/LibGUI/Toolbar.cpp @@ -88,7 +88,7 @@ private: } }; -void Toolbar::add_action(Action& action) +GUI::Button& Toolbar::add_action(Action& action) { auto item = make<Item>(); item->type = Item::Type::Action; @@ -98,6 +98,7 @@ void Toolbar::add_action(Action& action) button.set_fixed_size(m_button_size + 8, m_button_size + 8); m_items.append(move(item)); + return button; } void Toolbar::add_separator() diff --git a/Userland/Libraries/LibGUI/Toolbar.h b/Userland/Libraries/LibGUI/Toolbar.h index c51ab94513..c7f6e8c556 100644 --- a/Userland/Libraries/LibGUI/Toolbar.h +++ b/Userland/Libraries/LibGUI/Toolbar.h @@ -16,7 +16,7 @@ class Toolbar : public Widget { public: virtual ~Toolbar() override; - void add_action(Action&); + GUI::Button& add_action(GUI::Action&); void add_separator(); bool has_frame() const { return m_has_frame; } |