[vlc-devel] Qt & fractionnal scaling
Pierre Lamot
pierre at videolabs.io
Wed Feb 14 16:29:12 CET 2018
Hello,
Many user have reported issues with icons beeing too big on their system. The
issue arise when their desktop is configured to use a fractionnal scaling.
The main issue is that Qt reports an integral scale factor, so a scale factor
of 1.25 is reported as 1, 1.75 -> 2 and 1.5 -> 2 which can make a big
difference. This issue is known by Qt folks [1] but doesn't seems near to be
resolved.
I've been running some tests recently to try to work around this issue.
Solutions I've been testing with so far:
* Keep the current behavior
* Patch Qt to provide a rounded scale factor with preference for lower
value, assuming that users will prefer smaller icons rather than lage ones.
* Patch Qt to provide the real scale factor, this comes with some drawbacks
the most noticeable beeing that some native widget are poorly rendered (esp
checkbox and radio buttons)
* Manually detect system scale factor and force Qt scale. This should be
done using plateform specific API since we need to modify QT environment and
QDesktop can't be access before initialising Qt. This provides the same result
and has the same drawbacks as previous solution.
* Provide a global scaling option (to change QT_SCALE_FACTOR), modifying
QT_SCALE_FACTOR works well for icons and pixmap, but it tend to make fonts too
big or too small, we also need to ensure that (desktop scale factor x qt scale
factor >= 1) or qt rendering will be broken.
* Provide an icon scale option and scale every icons and pixmap according to
this scale (before the DPI scaling). This provides flexibility, but it's a
tedious task with probably many corner cases.
* Allow users to disable HiDPI scaling.
Thank you for your opinion and suggestion on this matter.
[1] https://bugreports.qt.io/browse/QTBUG-53022
--
Pierre Lamot
More information about the vlc-devel
mailing list