Skip to content
Commit 8bc554e6 authored by Nate Graham's avatar Nate Graham
Browse files

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.

An autotest makes sure that the calculated values are sane for common
screens.

Implements/fixes https://phabricator.kde.org/T13158
FIXED-IN: 5.27

Add autotest
parent 97ec579f
Pipeline #273564 passed with stage
in 1 minute and 24 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment