fix issue created when making button lvgl aware. First the lvgl event then the touchEnd event. Deleted touchEnd event code.
This commit is contained in:
committed by
Raphael Coeffic
parent
e97cb0a4dc
commit
92cb885018
+6
-19
@@ -80,30 +80,17 @@ void Button::onEvent(lv_event_t* event)
|
||||
if (enabled && code == LV_EVENT_CLICKED) {
|
||||
onKeyPress();
|
||||
onPress();
|
||||
}
|
||||
else {
|
||||
// FormField::onEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(HARDWARE_TOUCH)
|
||||
bool Button::onTouchStart(coord_t x, coord_t y)
|
||||
{
|
||||
Window::onTouchStart(x, y);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HARDWARE_TOUCH)
|
||||
bool Button::onTouchEnd(coord_t x, coord_t y)
|
||||
{
|
||||
if (enabled) {
|
||||
onKeyPress();
|
||||
if (!(windowFlags & NO_FOCUS)) {
|
||||
setFocus(SET_FOCUS_DEFAULT);
|
||||
}
|
||||
onPress();
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(HARDWARE_TOUCH)
|
||||
// this needs to stay so that viewmain doesnt get the touch event
|
||||
bool Button::onTouchEnd(coord_t x, coord_t y)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
-1
@@ -72,7 +72,6 @@ class Button: public FormField
|
||||
void onEvent(lv_event_t* e);// override;
|
||||
|
||||
#if defined(HARDWARE_TOUCH)
|
||||
bool onTouchStart(coord_t x, coord_t y) override;
|
||||
bool onTouchEnd(coord_t x, coord_t y) override;
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user