<table><tr><td style="">broulik updated this revision to Diff 29668.<br />broulik retitled this revision from "WIP: Support device pixel ratio in icon loader and engine" to "Support Icon Scale from Icon naming specification 0.13".<br />broulik edited the summary of this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-sotednx5d4juzl5/">(Show Details)</a><br />broulik edited the test plan for this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-rxg3lokb2hio364/">(Show Details)</a>
</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/D6313">View Revision</a></tr></table><br /><div><strong>CHANGES TO REVISION SUMMARY</strong><div><div style="white-space: pre-wrap; color: #74777D;">Since Qt 5.9 there's a <span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">`</span>ScaledPixmapHook<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">`</span> in <span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">`</span>QIconEngine<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">`</span> which is called when device pixel ratio is > 1 and it wants a scaled pixmap.<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);"> In contrast to regular `pixmap()` this also knows the scale factor.<br />
<br />
Implement support for `Icon Scale` properties introduced in Icon naming specification 0.13 [1] to choose an appropriate icon, if available,</span> <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">In contrast to regular pixmap this also knows the scale fact</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">rather than blatantly loading a larger icon that may not fit in the context and also could be hard to tell as its physical size will be smaller than what it was designed f</span>or.<br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">This way, when a 32px icon is requested, we can now tell whether we want a 16px scaled 2x or if it's a legitimate 32px request. It ensures that we keep symbolic small icons even on high-dpi screens where we would otherwise load the colorful and hard-to-see icons at the given physical size they ends up at.</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">[1] https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-0.13.html</span></div></div></div><br /><div><strong>CHANGES TO TEST PLAN</strong><div><div style="white-space: pre-wrap; color: #74777D;"><div style="padding: 8px 0;">...</div>{F3789199}<span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);"><br />
<br />
For testing I put a symlink from places/32 to places/16@2x and added the following to the `index.theme` of Breeze:<br />
```<br />
ScaledDirectories=places/16@2x<br />
...<br />
[places/16@2x]<br />
Size=16<br />
Scale=2<br />
Context=Places<br />
Type=Fixed<br />
```<br />
This way you designers can now create dedicated 2x SVGs for those usecases, ie. we can have a 16px icon as well as a 16px@2x icon rather than it just taking the 32px icon which might not fit. In case a 16px@2x icon is not present it will load the 32px icon instead as it did before. This way one could even create a high dpi Oxygen theme.</span></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R302 KIconThemes</div></div></div><br /><div><strong>CHANGES SINCE LAST UPDATE</strong><div><a href="https://phabricator.kde.org/D6313?vs=15690&id=29668">https://phabricator.kde.org/D6313?vs=15690&id=29668</a></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D6313">https://phabricator.kde.org/D6313</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/kiconengine.cpp<br />
src/kiconengine.h<br />
src/kiconloader.cpp<br />
src/kiconloader.h<br />
src/kicontheme.cpp<br />
src/kicontheme.h</div></div></div><br /><div><strong>To: </strong>broulik, kde-frameworks-devel, Plasma, VDG<br /><strong>Cc: </strong>rkflx, acrouthamel, ngraham, elvisangelaccio, mart, kvermette, cfeck, davidedmundson, plasma-devel, Frameworks, michaelh, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol<br /></div>