[Checkbox] Fix when disabled

This commit is contained in:
Bertrand Songis
2021-04-06 08:47:54 +02:00
parent 9858ce217e
commit 9291675a23
+6 -4
View File
@@ -44,10 +44,12 @@ void CheckBox::onEvent(event_t event)
#if defined(HARDWARE_TOUCH)
bool CheckBox::onTouchEnd(coord_t x, coord_t y)
{
onKeyPress();
_setValue(!getValue());
setFocus(SET_FOCUS_DEFAULT);
invalidate();
if (enabled) {
onKeyPress();
_setValue(!getValue());
setFocus(SET_FOCUS_DEFAULT);
invalidate();
}
return true;
}
#endif