summaryrefslogtreecommitdiff
path: root/src/DisplayApp/LittleVgl.h
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-03-08 20:46:25 (GMT)
committerJF <jf@codingfield.com>2020-03-08 20:46:25 (GMT)
commit0a5cd60fe86149f8958fc546e99f6370cb74950e (patch)
treed630a6c66d69d22c53b8011e215e1072875c6a29 /src/DisplayApp/LittleVgl.h
parentd834f40c1014ac8926af9aaadc434a49e632b000 (diff)
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.
Diffstat (limited to 'src/DisplayApp/LittleVgl.h')
-rw-r--r--src/DisplayApp/LittleVgl.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/DisplayApp/LittleVgl.h b/src/DisplayApp/LittleVgl.h
index 40fb180..555f5f0 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;
};
}
}