diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-06-12 05:57:26 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-06-12 05:57:26 +0200 |
commit | d7756fc09ff272c9369e68359b20ffc3e6fd8584 (patch) | |
tree | 0c8d9a557c83315ac709321225b193db58ef3651 /LibGUI/GButton.cpp | |
parent | cadc65a82dc0047205abf0c28ee30d2a4fd2ee60 (diff) | |
download | serenity-d7756fc09ff272c9369e68359b20ffc3e6fd8584.zip |
LibGUI: Add an "exclusive" property to GAbstractButtons.
This makes checkable buttons exclusive with other checkable buttons in the
same parent widget. Basically like radio buttons. This should probably be
used to implement GRadioButton once it's a bit more mature.
Diffstat (limited to 'LibGUI/GButton.cpp')
-rw-r--r-- | LibGUI/GButton.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/LibGUI/GButton.cpp b/LibGUI/GButton.cpp index 21b9f39043..6528131215 100644 --- a/LibGUI/GButton.cpp +++ b/LibGUI/GButton.cpp @@ -60,6 +60,8 @@ void GButton::click() { if (!is_enabled()) return; + if (is_checkable()) + set_checked(!is_checked()); if (on_click) on_click(*this); } |