Skip to content

Commit

Permalink
Update src/displayapp/screens/WatchFaceTerminal.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: NeroBurner <[email protected]>
  • Loading branch information
13werwolf13 and NeroBurner authored Feb 2, 2022
1 parent af483be commit 4d85028
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/displayapp/screens/WatchFaceTerminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,13 @@ void WatchFaceTerminal::Refresh() {
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() || batteryController.IsPowerPresent();
lv_label_set_text(batteryPlug, BatteryIcon::GetPlugIcon(isCharging));
lv_label_set_text_fmt(batteryValue, "[BATT]#387b54 %d%\%#", batteryPercent);
}

bleState = bleController.IsConnected();
Expand Down

0 comments on commit 4d85028

Please sign in to comment.