Added touch focus handling in view main

This commit is contained in:
Raphael Coeffic
2021-05-06 12:55:59 +02:00
committed by Raphael Coeffic
parent eb4e4af0d2
commit d877efddef
2 changed files with 13 additions and 0 deletions
+12
View File
@@ -239,6 +239,18 @@ bool ViewMain::onTouchSlide(coord_t x, coord_t y, coord_t startX, coord_t startY
return Window::onTouchSlide(x, y, startX, startY, slideX, slideY);
}
bool ViewMain::onTouchEnd(coord_t x, coord_t y)
{
if (Window::onTouchEnd(x,y)) return true;
if (!hasFocus()) {
setFocus();
}
else {
openMenu();
}
return true;
}
#endif
#if defined(HARDWARE_KEYS)
+1
View File
@@ -96,6 +96,7 @@ class ViewMain: public Window
unsigned int startSlidePage = 0;
bool onTouchSlide(coord_t x, coord_t y, coord_t startX, coord_t startY, coord_t slideX, coord_t slideY) override;
bool onTouchEnd(coord_t x, coord_t y) override;
#endif
void paint(BitmapBuffer * dc) override;