Fix: Prevent clicking disabled checkboxes (#1075)
This commit is contained in:
parent
3bcf588fbe
commit
5f777a7f45
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue