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

LibGUI: Add GActionGroup, a way to group a bunch of GActions.

This can be used to make a bunch of actions mutually exclusive.
This patch only implements the exclusivity behavior for buttons.
This commit is contained in:
Andreas Kling 2019-07-09 22:10:03 +02:00
parent 2ae0333f5d
commit 7083a0104a
9 changed files with 97 additions and 6 deletions

View file

@ -0,0 +1,14 @@
#include <LibGUI/GAction.h>
#include <LibGUI/GActionGroup.h>
void GActionGroup::add_action(GAction& action)
{
action.set_group({}, this);
m_actions.set(&action);
}
void GActionGroup::remove_action(GAction& action)
{
action.set_group({}, nullptr);
m_actions.remove(&action);
}