Double tap to enter fullscreen mode and slow tap to open widget menu
This commit is contained in:
@@ -25,6 +25,10 @@
|
|||||||
#include "view_main.h"
|
#include "view_main.h"
|
||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
|
|
||||||
|
#if defined(HARDWARE_TOUCH)
|
||||||
|
#include "touch.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
constexpr uint32_t WIDGET_FOCUS_TIMEOUT = 10*1000; // 10 seconds
|
constexpr uint32_t WIDGET_FOCUS_TIMEOUT = 10*1000; // 10 seconds
|
||||||
constexpr uint32_t FULLSCREEN_HINT_DELAY = 5*1000; // 5 seconds
|
constexpr uint32_t FULLSCREEN_HINT_DELAY = 5*1000; // 5 seconds
|
||||||
|
|
||||||
@@ -81,11 +85,14 @@ bool Widget::onTouchEnd(coord_t x, coord_t y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (hasFocus()) {
|
if (hasFocus()) {
|
||||||
onPress();
|
if (touchState.tapCount == 0)
|
||||||
return true;
|
onPress();
|
||||||
|
else if (touchState.tapCount > 1)
|
||||||
|
setFullscreen(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
setFocus();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user