fix for #444: Accidentally altering a checkbox.
This commit is contained in:
+9
-5
@@ -44,11 +44,15 @@ void CheckBox::onEvent(event_t event)
|
||||
#if defined(HARDWARE_TOUCH)
|
||||
bool CheckBox::onTouchEnd(coord_t x, coord_t y)
|
||||
{
|
||||
if (enabled) {
|
||||
onKeyPress();
|
||||
_setValue(!getValue());
|
||||
setFocus(SET_FOCUS_DEFAULT);
|
||||
invalidate();
|
||||
if (enabled)
|
||||
{
|
||||
if (x < (rect.w >> 2))
|
||||
{
|
||||
onKeyPress();
|
||||
_setValue(!getValue());
|
||||
setFocus(SET_FOCUS_DEFAULT);
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user