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)
|
#if defined(HARDWARE_TOUCH)
|
||||||
bool CheckBox::onTouchEnd(coord_t x, coord_t y)
|
bool CheckBox::onTouchEnd(coord_t x, coord_t y)
|
||||||
{
|
{
|
||||||
if (enabled) {
|
if (enabled)
|
||||||
onKeyPress();
|
{
|
||||||
_setValue(!getValue());
|
if (x < (rect.w >> 2))
|
||||||
setFocus(SET_FOCUS_DEFAULT);
|
{
|
||||||
invalidate();
|
onKeyPress();
|
||||||
|
_setValue(!getValue());
|
||||||
|
setFocus(SET_FOCUS_DEFAULT);
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user