Fix Kirigami.Units.devicePixelRatio=1.3 when it should be 1.0 at 96dpi

Authored by Zren on May 5 2020, 11:16 PM.



I recently noticed that Kirigami.Units.devicePixelRatio was 1.3 even though I was at the default 96dpi when writing a widget's config.

There's 4 different Units.qml, and I'm not certain which does what. 2 are in krigiami and the other 2 are in plasma-framework.

$ locate /Units.qml | grep /usr/
  • 2 years ago kirigami/src/controls/Units.qml (/usr/lib/qt/qml/org/kde/kirigami.2/Units.qml) was changed from 13/10 = 1.3 to multiply by 13*0.75 so that 9.75/10 = 0.975 (then max(1, 0.975) = 1).

There's 2 files owned by plasma-framework. The /styles/Plasma/Units.qml binds PlasmaCore's units.devicePixelRatio, so that leaves /styles/org.kde.desktop.plasma/Units.qml.

$ pacman -Qo /usr/lib/qt/qml/org/kde/kirigami.2/styles/org.kde.desktop.plasma/Units.qml
/usr/lib/qt/qml/org/kde/kirigami.2/styles/org.kde.desktop.plasma/Units.qml is owned by plasma-framework 5.69.0-2

This patch edits the org.kde.desktop.plasma style, and fixes qmlscene KirigamiDevicePixelRatioTest.qml, and plasmashell widget configs, and plasmoidviewer widget configs.

The Kirigami patch is D29462

Test Plan

You can edit /usr/lib/qt/qml/org/kde/kirigami.2/styles/org.kde.desktop.plasma/Units.qml then run:

and Kirigami.Units.devicePixelRatio should equal 1.

Diff Detail

R242 Plasma Framework (Library)
Lint Skipped
Unit Tests Skipped
Zren created this revision.May 5 2020, 11:16 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMay 5 2020, 11:16 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
Zren requested review of this revision.May 5 2020, 11:16 PM
Zren added reviewers: Kirigami, mart.
mart accepted this revision.May 19 2020, 1:43 PM
This revision is now accepted and ready to land.May 19 2020, 1:43 PM
ngraham closed this revision.Jun 9 2020, 2:46 PM