| 99 | } |
| 100 | |
| 101 | void BaseTheme::drawBatteryLeft(const GfxRenderer& renderer, Rect rect, const bool showPercentage) const { |
| 102 | // Left aligned: icon on left, percentage on right (reader mode) |
| 103 | const uint16_t percentage = powerManager.getBatteryPercentage(); |
| 104 | const int y = rect.y + 6; |
| 105 | |
| 106 | if (showPercentage) { |
| 107 | const auto percentageText = std::to_string(percentage) + "%"; |
| 108 | renderer.drawText(SMALL_FONT_ID, rect.x + batteryPercentSpacing + rect.width, rect.y, percentageText.c_str()); |
| 109 | } |
| 110 | |
| 111 | const Rect iconRect{rect.x, y, rect.width, rect.height}; |
| 112 | drawBatteryOutline(renderer, rect.x, y, rect.width, rect.height); |
| 113 | fillBatteryIcon(renderer, iconRect, percentage); |
| 114 | } |
| 115 | |
| 116 | void BaseTheme::drawBatteryRight(const GfxRenderer& renderer, Rect rect, const bool showPercentage) const { |
| 117 | // Right aligned: percentage on left, icon on right (UI headers) |
no test coverage detected