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.

This commit is contained in:
JF
2020-03-08 21:46:25 +01:00
parent d834f40c10
commit 0a5cd60fe8
212 changed files with 89114 additions and 32 deletions

View File

@@ -15,10 +15,15 @@ namespace Pinetime {
class LittleVgl {
public:
LittleVgl(Pinetime::Drivers::St7789& lcd, Pinetime::Drivers::Cst816S& touchPanel);
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;
};
}
}