<table><tr><td style="">Zren created this revision.<br />Herald added a project: Frameworks.<br />Herald added a subscriber: kde-frameworks-devel.<br />Zren requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D29463">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>I recently noticed that <tt style="background: #ebebeb; font-size: 13px;">Kirigami.Units.devicePixelRatio</tt> was <tt style="background: #ebebeb; font-size: 13px;">1.3</tt> even though I was at the default 96dpi when writing a widget's config.</p>

<p><a href="https://phabricator.kde.org/F8287886" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">F8287886: 2020-05-05___19-00-48.png</a></p>

<p>There's 4 different <tt style="background: #ebebeb; font-size: 13px;">Units.qml</tt>, and I'm not certain which does what. 2 are in <tt style="background: #ebebeb; font-size: 13px;">krigiami</tt> and the other 2 are in <tt style="background: #ebebeb; font-size: 13px;">plasma-framework</tt>.</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="console" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);"><span style="color: #000080">$ locate /Units.qml | grep /usr/</span>
<span style="color: #808080">/usr/lib/qt/qml/org/kde/kirigami.2/Units.qml</span>
<span style="color: #808080">/usr/lib/qt/qml/org/kde/kirigami.2/styles/Plasma/Units.qml</span>
<span style="color: #808080">/usr/lib/qt/qml/org/kde/kirigami.2/styles/org.kde.desktop/Units.qml</span>
<span style="color: #808080">/usr/lib/qt/qml/org/kde/kirigami.2/styles/org.kde.desktop.plasma/Units.qml</span></pre></div>



<ul class="remarkup-list">
<li class="remarkup-list-item">2 years ago <a href="https://github.com/KDE/kirigami/blame/master/src/controls/Units.qml#L75" class="remarkup-link" target="_blank" rel="noreferrer"><tt style="background: #ebebeb; font-size: 13px;">kirigami/src/controls/Units.qml</tt></a> (<tt style="background: #ebebeb; font-size: 13px;">/usr/lib/qt/qml/org/kde/kirigami.2/Units.qml</tt>) was changed from <tt style="background: #ebebeb; font-size: 13px;">13/10 = 1.3</tt> to multiply by <tt style="background: #ebebeb; font-size: 13px;">13*0.75</tt> so that <tt style="background: #ebebeb; font-size: 13px;">9.75/10 = 0.975</tt> (then <tt style="background: #ebebeb; font-size: 13px;">max(1, 0.975) = 1</tt>).</li>
</ul>

<hr class="remarkup-hr" />

<p>There's 2 files owned by <tt style="background: #ebebeb; font-size: 13px;">plasma-framework</tt>. The <tt style="background: #ebebeb; font-size: 13px;">/styles/Plasma/Units.qml</tt> binds PlasmaCore's <tt style="background: #ebebeb; font-size: 13px;">units.devicePixelRatio</tt>, so that leaves <tt style="background: #ebebeb; font-size: 13px;">/styles/org.kde.desktop.plasma/Units.qml</tt>.</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="console" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);"><span style="color: #000080">$ pacman -Qo /usr/lib/qt/qml/org/kde/kirigami.2/styles/org.kde.desktop.plasma/Units.qml</span>
<span style="color: #808080">/usr/lib/qt/qml/org/kde/kirigami.2/styles/org.kde.desktop.plasma/Units.qml is owned by plasma-framework 5.69.0-2</span></pre></div>

<p>This patch edits the <tt style="background: #ebebeb; font-size: 13px;">org.kde.desktop.plasma</tt> style, and fixes <tt style="background: #ebebeb; font-size: 13px;">qmlscene KirigamiDevicePixelRatioTest.qml</tt>, and <tt style="background: #ebebeb; font-size: 13px;">plasmashell</tt> widget configs, and <tt style="background: #ebebeb; font-size: 13px;">plasmoidviewer</tt> widget configs.</p>

<p>The Kirigami patch is <a href="https://phabricator.kde.org/D29462" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D29462</a></p></div></div><br /><div><strong>TEST PLAN</strong><div><p>You can edit <tt style="background: #ebebeb; font-size: 13px;">/usr/lib/qt/qml/org/kde/kirigami.2/styles/org.kde.desktop.plasma/Units.qml</tt> then run:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item"><a href="https://gist.github.com/Zren/621338b8cda7c550d7b43f8ea1ba71a7" class="remarkup-link" target="_blank" rel="noreferrer">https://gist.github.com/Zren/621338b8cda7c550d7b43f8ea1ba71a7</a></li>
<li class="remarkup-list-item"><tt style="background: #ebebeb; font-size: 13px;">qmlscene KirigamiDevicePixelRatioTest.qml</tt></li>
</ul>

<p>and <tt style="background: #ebebeb; font-size: 13px;">Kirigami.Units.devicePixelRatio</tt> should equal <tt style="background: #ebebeb; font-size: 13px;">1</tt>.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R242 Plasma Framework (Library)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D29463">https://phabricator.kde.org/D29463</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/declarativeimports/kirigamiplasmadesktopstyle/Units.qml<br />
src/declarativeimports/kirigamiplasmastyle/Units.qml</div></div></div><br /><div><strong>To: </strong>Zren<br /><strong>Cc: </strong>kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns<br /></div>