1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:28:12 +00:00

LibGUI: Add a GToolBar class that can be populated with GActions.

The same action can be added to both a menu and a toolbar.
Use this to put a toolbar into FileManager. This is pretty neat. :^)
This commit is contained in:
Andreas Kling 2019-02-20 02:39:46 +01:00
parent 4804609b7e
commit b704d3d295
24 changed files with 196 additions and 44 deletions

View file

@ -1,8 +1,8 @@
#include <LibGUI/GAction.h>
GAction::GAction(const String& text, const String& custom_data, Function<void(const GAction&)> on_activation_callback)
: m_text(text)
, on_activation(move(on_activation_callback))
: on_activation(move(on_activation_callback))
, m_text(text)
, m_custom_data(custom_data)
{
}
@ -12,6 +12,13 @@ GAction::GAction(const String& text, Function<void(const GAction&)> on_activatio
{
}
GAction::GAction(const String& text, RetainPtr<GraphicsBitmap>&& icon, Function<void(const GAction&)> on_activation_callback)
: on_activation(move(on_activation_callback))
, m_text(text)
, m_icon(move(icon))
{
}
GAction::~GAction()
{
}