Zren created this revision.
Herald added a project: Kirigami.
Herald added a subscriber: plasma-devel.
Zren requested review of this revision.

REVISION SUMMARY
  I recently noticed that `Kirigami.Units.devicePixelRatio` was `1.3` even 
though I was at the default 96dpi when writing a widget's config.
  
  F8287886: 2020-05-05___19-00-48.png <https://phabricator.kde.org/F8287886>
  
  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/
    /usr/lib/qt/qml/org/kde/kirigami.2/Units.qml
    /usr/lib/qt/qml/org/kde/kirigami.2/styles/Plasma/Units.qml
    /usr/lib/qt/qml/org/kde/kirigami.2/styles/org.kde.desktop/Units.qml
    /usr/lib/qt/qml/org/kde/kirigami.2/styles/org.kde.desktop.plasma/Units.qml
  
  
  
  - 2 years ago `kirigami/src/controls/Units.qml` 
<https://github.com/KDE/kirigami/blame/master/src/controls/Units.qml#L75> 
(`/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`).
  
  -----
  
  Which means this patch modifies the other file owned by `kirigami`:
  
    $ pacman -Qo 
/usr/lib/qt/qml/org/kde/kirigami.2/styles/org.kde.desktop/Units.qml
    /usr/lib/qt/qml/org/kde/kirigami.2/styles/org.kde.desktop/Units.qml is 
owned by kirigami2 5.69.0-1
  
  Note that this patch **does not fix** `qmlscene 
KirigamiDevicePixelRatioTest.qml`, nor a `plasmashell` widget, nor a 
`plasmoidviewer` widget. I'm not sure what uses the `org.kde.desktop` style, as 
`qmlscene` uses the `org.kde.desktop.plasma` it seems. The `plasma-framework` 
patch should fix `qmlscene`.

TEST PLAN
  You can edit 
`/usr/lib/qt/qml/org/kde/kirigami.2/styles/org.kde.desktop/Units.qml` to test 
this patch.
  
  -----
  
  To test the `plasma-frameworks` patch:
  
  Editing 
`/usr/lib/qt/qml/org/kde/kirigami.2/styles/org.kde.desktop.plasma/Units.qml` 
then running:
  
  - https://gist.github.com/Zren/621338b8cda7c550d7b43f8ea1ba71a7
  - `qmlscene KirigamiDevicePixelRatioTest.qml`
  
  and `Kirigami.Units.devicePixelRatio` should equal `1`.

REPOSITORY
  R169 Kirigami

REVISION DETAIL
  https://phabricator.kde.org/D29462

AFFECTED FILES
  src/controls/Units.qml
  src/styles/org.kde.desktop/Units.qml

To: Zren
Cc: plasma-devel, fbampaloukas, GB_2, domson, dkardarakos, ngraham, apol, 
ahiemstra, davidedmundson, mart

Reply via email to