Fix: Prevent clicking disabled checkboxes (#1075)

This commit is contained in:
Alezito2008
2026-03-10 00:03:39 -03:00
committed by GitHub
parent 3bcf588fbe
commit 5f777a7f45

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);