Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct way to determine battery percentage icon for the menu tray #119

Merged
merged 2 commits into from
Mar 26, 2023
Merged

Correct way to determine battery percentage icon for the menu tray #119

merged 2 commits into from
Mar 26, 2023

Conversation

igorkulman
Copy link
Contributor

As mentioned in #105 the way the battery percentage for the menu tray icon is computed is not correct, the issue mentions Display percentage 5 based on 46. The reason for this is that in

image_percentages.sort()
the sort is lexicographical resulting in [0, 10, 100, 15, 20, 25, 30, 35, 40, 45, 5, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95]

This PR fixes #105 using the correct sort and also simplifying the way the percentage is fetched from the sorted array.

@actuallymentor actuallymentor merged commit f601da1 into actuallymentor:main Mar 26, 2023
@actuallymentor
Copy link
Owner

Ah very nice one! I'll merge this and deploy in the next version.

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.

Percentage icon not accurate
2 participants