Fix: Prevent clicking disabled checkboxes

This commit is contained in:
Alezito2008 2026-03-09 19:04:46 -03:00
parent e9dba1fa56
commit 39a0fc2ea5

View file

@ -578,10 +578,13 @@ 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);
if (cb->IsEnabled())
{
bool newState = !cb->IsChecked(); bool newState = !cb->IsChecked();
cb->setChecked(newState); cb->setChecked(newState);
handleCheckboxToggled((F64)bestId, newState); handleCheckboxToggled((F64)bestId, newState);
} }
}
else else
{ {
handlePress((F64)bestId, 0); handlePress((F64)bestId, 0);