LibGUI+WindowServer: Make it possible to have checkable GActions.

They show up as checkable GButtons in GToolBar, and with (or without) check
marks in menus.

There are a bunch of places to make use of this. This patch only takes
advantage of it in the FileManager for the view type actions.
This commit is contained in:
Andreas Kling 2019-04-26 21:09:56 +02:00
parent 9ff36afeaa
commit 8f81a3f9dd
Notes: sideshowbarker 2024-07-19 14:34:35 +09:00
15 changed files with 148 additions and 20 deletions

View file

@ -133,6 +133,9 @@ void GButton::set_action(GAction& action)
m_action = action.make_weak_ptr();
action.register_button({ }, *this);
set_enabled(action.is_enabled());
set_checkable(action.is_checkable());
if (action.is_checkable())
set_checked(action.is_checked());
}
void GButton::set_icon(RetainPtr<GraphicsBitmap>&& icon)