diff options
author | JF <jf@codingfield.com> | 2020-02-16 18:32:36 +0100 |
---|---|---|
committer | JF <jf@codingfield.com> | 2020-02-16 18:32:36 +0100 |
commit | 167a0ffc873a2442af43d0347efd00f84932b8cc (patch) | |
tree | 2e131e3c97b1c67e0dff6bab516a1fe5958e1741 /src/DisplayApp/Screens/Clock.h | |
parent | 52539a5ff1b6f52c65b032ef1668d43d4df2dc24 (diff) |
Add touch panel port to lvgl.
PoC of user interaction with 3 screen (clock, menu and app).
Diffstat (limited to 'src/DisplayApp/Screens/Clock.h')
-rw-r--r-- | src/DisplayApp/Screens/Clock.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/DisplayApp/Screens/Clock.h b/src/DisplayApp/Screens/Clock.h index f5328535..d6e5a288 100644 --- a/src/DisplayApp/Screens/Clock.h +++ b/src/DisplayApp/Screens/Clock.h @@ -21,7 +21,7 @@ namespace Pinetime { explicit DirtyValue(T v) { value = v; } explicit DirtyValue(T& v) { value = v; } bool IsUpdated() const { return isUpdated; } - T& Get() { return value; this->isUpdated = false;} + T& Get() { this->isUpdated = false; return value; } DirtyValue& operator=(const T& other) { this->value = other; @@ -35,19 +35,23 @@ namespace Pinetime { class Clock : public Screen{ public: enum class BleConnectionStates{ NotConnected, Connected}; - Clock(Components::Gfx& gfx); + Clock(DisplayApp* app, Components::Gfx& gfx, Controllers::DateTime& dateTimeController); + ~Clock() override; void Refresh(bool fullRefresh) override; void SetBatteryPercentRemaining(uint8_t percent) { batteryPercentRemaining = percent; } void SetBleConnectionState(BleConnectionStates state) { bleState = state; } void SetCurrentDateTime(const std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds>& tp) { currentDateTime = tp;} + void OnObjectEvent(lv_obj_t *pObj, lv_event_t i); private: static const char* MonthToString(Pinetime::Controllers::DateTime::Months month); static const char* DayOfWeekToString(Pinetime::Controllers::DateTime::Days dayOfWeek); static char const *DaysString[]; static char const *MonthsString[]; + char displayedChar[5]; + const FONT_INFO largeFont {lCD_70ptFontInfo.height, lCD_70ptFontInfo.startChar, lCD_70ptFontInfo.endChar, lCD_70ptFontInfo.spacePixels, lCD_70ptFontInfo.charInfo, lCD_70ptFontInfo.data}; const FONT_INFO smallFont {lCD_14ptFontInfo.height, lCD_14ptFontInfo.startChar, lCD_14ptFontInfo.endChar, lCD_14ptFontInfo.spacePixels, lCD_14ptFontInfo.charInfo, lCD_14ptFontInfo.data}; @@ -69,6 +73,9 @@ namespace Pinetime { lv_obj_t* label_time; lv_obj_t* label_date; lv_obj_t* label_version; + lv_obj_t* backgroundLabel; + + Controllers::DateTime& dateTimeController; }; } |