refactor: Deduplicate battery drawing code and fix Lyra charging indicator (#1437)
## Summary **What is the goal of this PR?** Following up on #1427: - Extracted shared battery drawing logic, including lightning bolt, to reduce duplication. - In Lyra with segmented battery the lightning bolt was hard to see, so when charging Lyra now uses a solid battery fill. --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**PARTIALLY**_
This commit is contained in:
@@ -142,4 +142,9 @@ class BaseTheme {
|
||||
virtual void drawTextField(const GfxRenderer& renderer, Rect rect, const int textWidth) const;
|
||||
virtual void drawKeyboardKey(const GfxRenderer& renderer, Rect rect, const char* label, const bool isSelected) const;
|
||||
virtual bool showsFileIcons() const { return false; }
|
||||
|
||||
// Shared constants and helpers for battery drawing (used by all themes)
|
||||
static constexpr int batteryPercentSpacing = 4;
|
||||
static void drawBatteryOutline(const GfxRenderer& renderer, int x, int y, int battWidth, int rectHeight);
|
||||
static void drawBatteryLightningBolt(const GfxRenderer& renderer, int boltX, int boltY);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user