summaryrefslogtreecommitdiff
path: root/LibGUI/GButton.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-06-12 05:57:26 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-06-12 05:57:26 +0200
commitd7756fc09ff272c9369e68359b20ffc3e6fd8584 (patch)
tree0c8d9a557c83315ac709321225b193db58ef3651 /LibGUI/GButton.cpp
parentcadc65a82dc0047205abf0c28ee30d2a4fd2ee60 (diff)
downloadserenity-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.cpp2
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);
}