Skip to content

fix: align battery icon based on context (UI / Reader)#796

Merged
daveallie merged 5 commits intocrosspoint-reader:masterfrom
pablohc:fix/battery-icon
Feb 16, 2026
Merged

fix: align battery icon based on context (UI / Reader)#796
daveallie merged 5 commits intocrosspoint-reader:masterfrom
pablohc:fix/battery-icon

Conversation

@pablohc
Copy link
Contributor

@pablohc pablohc commented Feb 9, 2026

Issues solved: #729 and #739

Summary

  • What is the goal of this PR?
    Currently, the battery icon and charge percentage were aligned to the left even for the UI, where they were positioned on the right side of the screen. This meant that when changing values of different numbers of digits, the battery would shift, creating a block of icons and text that was illegible.

  • What changes are included?

  • Add drawBatteryUi() method for right-aligned battery display in UI headers
  • Keep drawBattery() for left-aligned display in reader mode
  • Extract drawBatteryIcon() helper to reduce code duplication
  • Battery icon now stays fixed at right edge regardless of percentage digits
  • Text adjusts to left of icon in UI mode, to right of icon in reader mode

Additional Context

  • Add any other information that might be helpful for the reviewer
  • This fix applies to both themes (Base and Lyra).

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? < YES >

- Add drawBatteryUi() method for right-aligned battery display in UI headers
- Keep drawBattery() for left-aligned display in reader mode
- Extract drawBatteryIcon() helper to reduce code duplication
- Battery icon now stays fixed at right edge regardless of percentage digits
- Text adjusts to left of icon in UI mode, to right of icon in reader mode
@jonasdiemer
Copy link
Contributor

Seems to fix #739 - I would propose to move the whole battery+number on Home Screen etc. a bit further to the right to align it with the button edge (on base theme).

However, #729 still is an issue - to reproduce, go Home and press around when the battery is around 99-100%. It is redrawn each time the selection changes, but the old value is not cleared out, so 2 numbers are written on top of each other.

@pablohc pablohc requested a review from jonasdiemer February 12, 2026 09:49
@pablohc
Copy link
Contributor Author

pablohc commented Feb 12, 2026

Thanks for the feedback @jonasdiemer, it should be fixed now.
Please let me know if you see anything that could be improved.

Copy link
Contributor

@jonasdiemer jonasdiemer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on device, looks good.

@daveallie daveallie merged commit d6f38d4 into crosspoint-reader:master Feb 16, 2026
6 checks passed
Unintendedsideeffects pushed a commit to Unintendedsideeffects/crosspoint-reader that referenced this pull request Feb 17, 2026
…ader#796)

Issues solved: crosspoint-reader#729 and crosspoint-reader#739

## Summary

* **What is the goal of this PR?**
Currently, the battery icon and charge percentage were aligned to the
left even for the UI, where they were positioned on the right side of
the screen. This meant that when changing values of different numbers of
digits, the battery would shift, creating a block of icons and text that
was illegible.

* **What changes are included?**
- Add drawBatteryUi() method for right-aligned battery display in UI
headers
- Keep drawBattery() for left-aligned display in reader mode
- Extract drawBatteryIcon() helper to reduce code duplication
- Battery icon now stays fixed at right edge regardless of percentage
digits
- Text adjusts to left of icon in UI mode, to right of icon in reader
mode

## Additional Context

* Add any other information that might be helpful for the reviewer 
* This fix applies to both themes (Base and Lyra).

---

### 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? _**< YES >**_
saslv pushed a commit to saslv/crosspoint-reader that referenced this pull request Feb 19, 2026
…ader#796)

Issues solved: crosspoint-reader#729 and crosspoint-reader#739

## Summary

* **What is the goal of this PR?**
Currently, the battery icon and charge percentage were aligned to the
left even for the UI, where they were positioned on the right side of
the screen. This meant that when changing values of different numbers of
digits, the battery would shift, creating a block of icons and text that
was illegible.

* **What changes are included?**
- Add drawBatteryUi() method for right-aligned battery display in UI
headers
- Keep drawBattery() for left-aligned display in reader mode
- Extract drawBatteryIcon() helper to reduce code duplication
- Battery icon now stays fixed at right edge regardless of percentage
digits
- Text adjusts to left of icon in UI mode, to right of icon in reader
mode

## Additional Context

* Add any other information that might be helpful for the reviewer 
* This fix applies to both themes (Base and Lyra).

---

### 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? _**< YES >**_
el pushed a commit to el/crosspoint-reader that referenced this pull request Feb 19, 2026
…ader#796)

Issues solved: crosspoint-reader#729 and crosspoint-reader#739

## Summary

* **What is the goal of this PR?**
Currently, the battery icon and charge percentage were aligned to the
left even for the UI, where they were positioned on the right side of
the screen. This meant that when changing values of different numbers of
digits, the battery would shift, creating a block of icons and text that
was illegible.

* **What changes are included?**
- Add drawBatteryUi() method for right-aligned battery display in UI
headers
- Keep drawBattery() for left-aligned display in reader mode
- Extract drawBatteryIcon() helper to reduce code duplication
- Battery icon now stays fixed at right edge regardless of percentage
digits
- Text adjusts to left of icon in UI mode, to right of icon in reader
mode

## Additional Context

* Add any other information that might be helpful for the reviewer 
* This fix applies to both themes (Base and Lyra).

---

### 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? _**< YES >**_
@pablohc pablohc deleted the fix/battery-icon branch February 27, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants