diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-11-10 22:49:02 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-11-10 22:49:02 +0100 |
commit | cab9933834eccca39d03bd1ac2852bec1fbb7d14 (patch) | |
tree | 8bba391f56684f66b6fca33a44dccc79c1580131 | |
parent | c8637e0206f6162a67663a08646c4fc128d147ef (diff) | |
download | serenity-cab9933834eccca39d03bd1ac2852bec1fbb7d14.zip |
GToolBar: Make buttons exclusive if action belongs to exclusive group
This was probably what I had originally intended when I first wrote the
GActionGroup stuff, but it seems to have been forgotten.
-rw-r--r-- | Libraries/LibGUI/GToolBar.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Libraries/LibGUI/GToolBar.cpp b/Libraries/LibGUI/GToolBar.cpp index 6e21ddbd1d..59b32c2725 100644 --- a/Libraries/LibGUI/GToolBar.cpp +++ b/Libraries/LibGUI/GToolBar.cpp @@ -1,4 +1,5 @@ #include <LibGUI/GAction.h> +#include <LibGUI/GActionGroup.h> #include <LibGUI/GBoxLayout.h> #include <LibGUI/GButton.h> #include <LibGUI/GPainter.h> @@ -36,6 +37,8 @@ void GToolBar::add_action(GAction& action) item->action = action; auto button = GButton::construct(this); + if (action.group() && action.group()->is_exclusive()) + button->set_exclusive(true); button->set_action(*item->action); button->set_tooltip(item->action->text()); if (item->action->icon()) |