[Checkbox] Fix when disabled

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