andyvorld / LGSTrayBattery

A tray app used to track battery levels of wireless Logitech mouse.
GNU General Public License v3.0
369 stars 30 forks source link

Bad display of the battery level #103

Closed d3kxrma closed 7 months ago

d3kxrma commented 7 months ago

When I set that I want to see the battery percentage, I saw that part of the widget that shows the percentage disappeared somewhere. Maybe it's a bug in the program, or maybe it's a bug in my system (Windows 10 Pro 22H2 19045.3930). If it's a bug in my system, please help me solve it. image

tr4npt commented 7 months ago

The problem is that the icon being created is 256x256 and Windows is scaling it down to fit on the taskbar. All of the blank space is getting averaged with the text pixels due to the sampling algorithm, resulting in bad text. I have a fix for this issue and submitted a pull request.

andyvorld commented 7 months ago

@tr4npt Thanks for the PR, however on my system SystemParameters.SmallIconHeight seems to always return 16. While through trial and error my trayicon seems to be around 40 pixels at 125% UI scaling.

I have found that it is possible to obtain the current user's UI scaling at login within the registry, so while it won't be reactive if the user changes UI scaling during a session, at least the scaling will be better.

andyvorld commented 7 months ago

Changes are in for v3.0.3

d3kxrma commented 7 months ago

Thanks for fixing the bug, everything works great now. image