From 4b18ac42e980398fcfe4d08e23b85ff2a6463df1 Mon Sep 17 00:00:00 2001 From: Totoo Date: Sun, 5 Oct 2025 17:04:30 +0200 Subject: [PATCH] full blue batt when charging (#2804) --- firmware/common/ui_widget.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/firmware/common/ui_widget.cpp b/firmware/common/ui_widget.cpp index 41d277233..2f884f0cb 100644 --- a/firmware/common/ui_widget.cpp +++ b/firmware/common/ui_widget.cpp @@ -2167,12 +2167,14 @@ void BatteryIcon::paint(Painter& painter) { int8_t ptd = (int8_t)((static_cast(percent_) / 100.0f) * (float)ppx + 0.5); // pixels to draw int8_t pp = ppx - ptd; // pixels to start from - if (percent_ >= 70) - battColor = Theme::getInstance()->fg_green->foreground; - else if (percent_ >= 40) - battColor = Theme::getInstance()->fg_orange->foreground; - else - battColor = Theme::getInstance()->fg_red->foreground; + if (!charge_) { + if (percent_ >= 70) + battColor = Theme::getInstance()->fg_green->foreground; + else if (percent_ >= 40) + battColor = Theme::getInstance()->fg_orange->foreground; + else + battColor = Theme::getInstance()->fg_red->foreground; + } // fill the bars for (int y = pp; y < ppx; y++) { painter.draw_hline({rect.left() + 2, rect.top() + 3 + y}, rect.width() - 4, battColor);