summaryrefslogtreecommitdiff
path: root/src/DisplayApp/LittleVgl.h
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-03-09 21:29:12 +0100
committerJF <jf@codingfield.com>2020-03-09 21:29:12 +0100
commit35e221078bf8e7b1548f5b75c391404d098442a0 (patch)
tree283687c96c5b8a33716229cc77c0fd23cc2ae5dd /src/DisplayApp/LittleVgl.h
parent968f18f4727d865242fc67d55f298b196f75b0f8 (diff)
Add support for gestures and integrate it with the vertical scrolling transition.
Diffstat (limited to 'src/DisplayApp/LittleVgl.h')
-rw-r--r--src/DisplayApp/LittleVgl.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/DisplayApp/LittleVgl.h b/src/DisplayApp/LittleVgl.h
index 555f5f0f..c6e728b2 100644
--- a/src/DisplayApp/LittleVgl.h
+++ b/src/DisplayApp/LittleVgl.h
@@ -14,6 +14,7 @@ namespace Pinetime {
namespace Components {
class LittleVgl {
public:
+ enum class FullRefreshDirections { None, Up, Down };
LittleVgl(Pinetime::Drivers::St7789& lcd, Pinetime::Drivers::Cst816S& touchPanel);
LittleVgl(const LittleVgl&) = delete;
@@ -23,7 +24,9 @@ namespace Pinetime {
void FlushDisplay(const lv_area_t * area, lv_color_t * color_p);
bool GetTouchPadInfo(lv_indev_data_t *ptr);
- void SetFullRefresh();
+ void SetFullRefresh(FullRefreshDirections direction);
+ void SetNewTapEvent(uint16_t x, uint16_t y);
+
private:
void InitDisplay();
void InitTouchpad();
@@ -99,15 +102,17 @@ namespace Pinetime {
lv_style_t win_btn_pr;
bool firstTouch = true;
- bool fullRefresh = false;
static constexpr uint8_t nbWriteLines = 4;
static constexpr uint16_t totalNbLines = 320;
static constexpr uint16_t visibleNbLines = 240;
static constexpr uint8_t MaxScrollOffset() { return LV_VER_RES_MAX - nbWriteLines; }
- enum class ScrollDirections {Unknown, Up, Down};
- ScrollDirections scrollDirection = ScrollDirections::Up;
+ FullRefreshDirections scrollDirection = FullRefreshDirections::None;
uint16_t writeOffset = 0;
uint16_t scrollOffset = 0;
+
+ uint16_t tap_x = 0;
+ uint16_t tap_y = 0;
+ bool tapped = false;
};
}
}