kded: refine initial best scale calculation
Right now the "best scale" calculation returns 2.0 or 1.0 based on a screen's DPI and whether it has 1440 or more vertical pixels. This works but its fairly basic algorithm misses many screens that would benefit from some scaling.
In the messy world we live in, many people have screens with fewer physical pixels than that, and would benefit from scaling. Biological factors in how eyes work cause a screen's ideal scale factor to be based on the physical size of items on screen, which is a function of its distance from the user's eyes and its pixel density. If we know these, we can compute an appropriate scale factor for it.
Unfortunately we can't know how far away the screen is from the user's eyes. As a result, we have to guesstimate based on what type of device it is plus common sense; people tend to use smaller screens closer to their faces. For example, if we know a screen is a built-in laptop screen, its ideal scale factor is slightly smaller than if it were a small desktop screen.
Accordingly, this commit introduces a new calculation that does away with the pixel size limit and attempts to compute an ideal scale based on a screen's device type and DPI. Computed scale factors are rounded to the nearest 25%.
Implements/fixes https://phabricator.kde.org/T13158 FIXED-IN: 5.27
@teams/usability @ratijas @davidedmundson
Test plan
- Apply the MR and compile
- Move aside
~/.local/share/kscreen/
- Reboot and see if the auto-chosen scale for your hardware feels okay