1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-05 08:37:35 +00:00

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.
This commit is contained in:
Andreas Kling 2019-06-12 05:57:26 +02:00
parent cadc65a82d
commit d7756fc09f
4 changed files with 31 additions and 0 deletions

View file

@ -60,6 +60,8 @@ void GButton::click()
{
if (!is_enabled())
return;
if (is_checkable())
set_checked(!is_checked());
if (on_click)
on_click(*this);
}