diff options
| author | Riku Isokoski <riksu9000@gmail.com> | 2021-10-05 09:45:03 (GMT) |
|---|---|---|
| committer | Riku Isokoski <riksu9000@gmail.com> | 2021-10-05 09:45:03 (GMT) |
| commit | f61e88b8425f9edcd38e47027df62dcc56c83adc (patch) | |
| tree | 1faacaf82f085ce6ca718d598b13a4f509a8e0ff /src/displayapp/screens/WatchFaceDigital.cpp | |
| parent | e468acc99e4d7e188dc902983640f5eb8e8ff31f (diff) | |
| parent | 392c7ad2aceecd8fe976165b66d39f0ed2083911 (diff) | |
Merge branch 'develop' into update_touch_driver
Diffstat (limited to 'src/displayapp/screens/WatchFaceDigital.cpp')
| -rw-r--r-- | src/displayapp/screens/WatchFaceDigital.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index 58ab619..2ecab60 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -102,12 +102,20 @@ WatchFaceDigital::~WatchFaceDigital() { } void WatchFaceDigital::Refresh() { + powerPresent = batteryController.IsPowerPresent(); + if (powerPresent.IsUpdated()) { + lv_label_set_text(batteryPlug, BatteryIcon::GetPlugIcon(powerPresent.Get())); + } + batteryPercentRemaining = batteryController.PercentRemaining(); if (batteryPercentRemaining.IsUpdated()) { auto batteryPercent = batteryPercentRemaining.Get(); + if (batteryPercent == 100) { + lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN); + } else { + lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE); + } lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); - auto isCharging = batteryController.IsCharging() or batteryController.IsPowerPresent(); - lv_label_set_text(batteryPlug, BatteryIcon::GetPlugIcon(isCharging)); } bleState = bleController.IsConnected(); |
