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:
kevin koenig
2022-06-11 15:13:11 +02:00
committed by Raphael Coeffic
parent e97cb0a4dc
commit 92cb885018
2 changed files with 6 additions and 20 deletions
+6 -19
View File
@@ -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
View File
@@ -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