diff options
| author | Riku Isokoski <riksu9000@gmail.com> | 2022-04-07 14:28:04 (GMT) |
|---|---|---|
| committer | Michele Bini <michele.bini@gmail.com> | 2022-06-06 05:32:21 (GMT) |
| commit | fab003528965668e2855491b36b5ba553c6a52f5 (patch) | |
| tree | 03cb04e9813b381ef7626970d549b58191f379d4 /src/displayapp/screens/Tile.cpp | |
| parent | fbfb8fa4a2ca9274c73f2ba2e6cec4b8fc9e8ad4 (diff) | |
New sharper batteryicon. Remove old unused batteryicons
Diffstat (limited to 'src/displayapp/screens/Tile.cpp')
| -rw-r--r-- | src/displayapp/screens/Tile.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/displayapp/screens/Tile.cpp b/src/displayapp/screens/Tile.cpp index c63b5ac..3cb811a 100644 --- a/src/displayapp/screens/Tile.cpp +++ b/src/displayapp/screens/Tile.cpp @@ -33,14 +33,12 @@ Tile::Tile(uint8_t screenID, // Time label_time = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text(label_time, dateTimeController.FormattedTime().c_str()); lv_label_set_align(label_time, LV_LABEL_ALIGN_CENTER); lv_obj_align(label_time, nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 0); // Battery - batteryIcon = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryController.PercentRemaining())); - lv_obj_align(batteryIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, -8, 0); + batteryIcon.Create(lv_scr_act()); + lv_obj_align(batteryIcon.GetObject(), nullptr, LV_ALIGN_IN_TOP_RIGHT, -8, 0); if (numScreens > 1) { pageIndicatorBasePoints[0].x = LV_HOR_RES - 1; @@ -111,6 +109,8 @@ Tile::Tile(uint8_t screenID, lv_label_set_text_static(backgroundLabel, ""); taskUpdate = lv_task_create(lv_update_task, 5000, LV_TASK_PRIO_MID, this); + + UpdateScreen(); } Tile::~Tile() { @@ -120,7 +120,7 @@ Tile::~Tile() { void Tile::UpdateScreen() { lv_label_set_text(label_time, dateTimeController.FormattedTime().c_str()); - lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryController.PercentRemaining())); + batteryIcon.SetBatteryPercentage(batteryController.PercentRemaining()); } void Tile::OnValueChangedEvent(lv_obj_t* obj, uint32_t buttonId) { |
