mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibGUI+WindowServer: Add support for enabled/disabled actions.
The enabled state of a GAction now propagates both to any toolbar buttons and any menu items linked to the action. Toolbar buttons are painted in a grayed out style when disabled. Menu items are gray when disabled. :^)
This commit is contained in:
@@ -26,6 +26,7 @@ void GToolBar::add_action(Retained<GAction>&& action)
|
||||
item->action = move(action);
|
||||
|
||||
auto* button = new GButton(this);
|
||||
button->set_action(*item->action);
|
||||
button->set_tooltip(item->action->text());
|
||||
if (item->action->icon())
|
||||
button->set_icon(item->action->icon());
|
||||
|
||||
Reference in New Issue
Block a user