From 0a5cd60fe86149f8958fc546e99f6370cb74950e Mon Sep 17 00:00:00 2001 From: JF Date: Sun, 8 Mar 2020 21:46:25 +0100 Subject: When a full screen refresh is done, apply a vertical scroll during the refresh. This makes the transition from one screen the another one smoother, even if the refresh rate is slow. --- src/DisplayApp/LittleVgl.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/DisplayApp/LittleVgl.h') diff --git a/src/DisplayApp/LittleVgl.h b/src/DisplayApp/LittleVgl.h index 40fb1809..555f5f0f 100644 --- a/src/DisplayApp/LittleVgl.h +++ b/src/DisplayApp/LittleVgl.h @@ -15,10 +15,15 @@ namespace Pinetime { class LittleVgl { public: LittleVgl(Pinetime::Drivers::St7789& lcd, Pinetime::Drivers::Cst816S& touchPanel); - void FlushDisplay(const lv_area_t * area, lv_color_t * color_p); + LittleVgl(const LittleVgl&) = delete; + LittleVgl& operator=(const LittleVgl&) = delete; + LittleVgl(LittleVgl&&) = delete; + LittleVgl& operator=(LittleVgl&&) = delete; + void FlushDisplay(const lv_area_t * area, lv_color_t * color_p); bool GetTouchPadInfo(lv_indev_data_t *ptr); + void SetFullRefresh(); private: void InitDisplay(); void InitTouchpad(); @@ -94,6 +99,15 @@ 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; + uint16_t writeOffset = 0; + uint16_t scrollOffset = 0; }; } } -- cgit v1.2.3-70-g09d2