Fix: Prevent clicking disabled checkboxes (#1075)
This commit is contained in:
@@ -578,9 +578,12 @@ bool UIScene::handleMouseClick(F32 x, F32 y)
|
|||||||
if (bestCtrl->getControlType() == UIControl::eCheckBox)
|
if (bestCtrl->getControlType() == UIControl::eCheckBox)
|
||||||
{
|
{
|
||||||
UIControl_CheckBox *cb = static_cast<UIControl_CheckBox*>(bestCtrl);
|
UIControl_CheckBox *cb = static_cast<UIControl_CheckBox*>(bestCtrl);
|
||||||
bool newState = !cb->IsChecked();
|
if (cb->IsEnabled())
|
||||||
cb->setChecked(newState);
|
{
|
||||||
handleCheckboxToggled((F64)bestId, newState);
|
bool newState = !cb->IsChecked();
|
||||||
|
cb->setChecked(newState);
|
||||||
|
handleCheckboxToggled((F64)bestId, newState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user