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:
parent
2ae0333f5d
commit
7083a0104a
9 changed files with 97 additions and 6 deletions
14
Libraries/LibGUI/GActionGroup.cpp
Normal file
14
Libraries/LibGUI/GActionGroup.cpp
Normal 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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue