mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-12-16 16:24:11 -05:00
full blue batt when charging (#2804)
This commit is contained in:
parent
41dd0c4674
commit
4b18ac42e9
1 changed files with 8 additions and 6 deletions
|
|
@ -2167,12 +2167,14 @@ void BatteryIcon::paint(Painter& painter) {
|
||||||
int8_t ptd = (int8_t)((static_cast<float>(percent_) / 100.0f) * (float)ppx + 0.5); // pixels to draw
|
int8_t ptd = (int8_t)((static_cast<float>(percent_) / 100.0f) * (float)ppx + 0.5); // pixels to draw
|
||||||
int8_t pp = ppx - ptd; // pixels to start from
|
int8_t pp = ppx - ptd; // pixels to start from
|
||||||
|
|
||||||
|
if (!charge_) {
|
||||||
if (percent_ >= 70)
|
if (percent_ >= 70)
|
||||||
battColor = Theme::getInstance()->fg_green->foreground;
|
battColor = Theme::getInstance()->fg_green->foreground;
|
||||||
else if (percent_ >= 40)
|
else if (percent_ >= 40)
|
||||||
battColor = Theme::getInstance()->fg_orange->foreground;
|
battColor = Theme::getInstance()->fg_orange->foreground;
|
||||||
else
|
else
|
||||||
battColor = Theme::getInstance()->fg_red->foreground;
|
battColor = Theme::getInstance()->fg_red->foreground;
|
||||||
|
}
|
||||||
// fill the bars
|
// fill the bars
|
||||||
for (int y = pp; y < ppx; y++) {
|
for (int y = pp; y < ppx; y++) {
|
||||||
painter.draw_hline({rect.left() + 2, rect.top() + 3 + y}, rect.width() - 4, battColor);
|
painter.draw_hline({rect.left() + 2, rect.top() + 3 + y}, rect.width() - 4, battColor);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue