LibGUI: Make GUI::Toolbar::add_action() return the toolbar button

Previously there was no easy way for clients to access the button.
This commit is contained in:
Andreas Kling 2021-05-15 22:23:13 +02:00
commit 5daf7bd2ef
Notes: sideshowbarker 2024-07-18 18:04:31 +09:00
2 changed files with 3 additions and 2 deletions

View file

@ -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()