<table><tr><td style="">kossebau created this revision.<br />kossebau added reviewers: Plasma, VDG, mart, davidedmundson, ngraham.<br />Herald added a project: Plasma.<br />Herald added a subscriber: plasma-devel.<br />kossebau 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/D20112">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Currently the shadow offset of the hands as well as the rotation center of<br />
the hands is hardcoded to match the light model and the hands shape of the<br />
Breeze theme. As well did some older change to move the rotation center to<br />
width/2 in y direction break older themes which relied on the y=0 offset.</p>

<p>This patch adds the option for themes to control the shadow offset as well<br />
as define the rotation offset for each hand (to avoid the need to create<br />
large pixmaps as workaround with empty space to match the assumption of<br />
the center to be at (width/2, width/2), by these new hints:</p>

<p>One shadow offset for all hands, as the simulated physical model can be<br />
assumed to have all hands almost on same layer (also matching that we have<br />
only one shadow for stacked objects, like windows, elsewhere):</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">hint-hands-shadow-offset-to-west/hint-hands-shadows-offset-to-east</li>
<li class="remarkup-list-item">hint-hands-shadow-offset-to-north/hint-hands-shadow-offset-to-south</li>
</ul>

<p>(west vs. east & north vs. south as negative rect size is not possible).<br />
If no hint is set, defaults to 0.<br />
The default of 0 is a small breakage, but almost all themes from<br />
store.kde.org do not use a shadow, also was the hour shadow broken/not shown<br />
until recently and only fixed for upcoming Plasma 5.16, where the offset of<br />
the shadows was tuned as well,  so any themes with hand shadows will need<br />
some tuning for Plasma 5.16 in any case.</p>

<p>Separate rotation offsets for all hands & their shadows, so pixmaps can be<br />
as small as needed, with no transparent area padding needed:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">hint-hourhand-rotation-center-offset</li>
<li class="remarkup-list-item">hint-hourhandshadow-rotation-center-offset</li>
<li class="remarkup-list-item">hint-minutehand-rotation-center-offset</li>
<li class="remarkup-list-item">hint-minutehandshadow-rotation-center-offset</li>
<li class="remarkup-list-item">hint-secondhand-rotation-center-offset</li>
<li class="remarkup-list-item">hint-secondhandshadow-rotation-center-offset</li>
</ul>

<p>The offset is taken from by the (width,height) of the hint element.<br />
Sadly this does not allow to specify a 0 in any dimension, as such an item<br />
is not passed through from QSvgRenderer/Plasms::Svg. Most themes might not<br />
need that though, so the few which might have to fall back to padding with<br />
transparent area.<br />
If no hint is set, defaults to (width/2, width/2).</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Clocks of unmodified themes from store.kde.org still look as before.<br />
Themes with hints added have shadows at proper place as well as rotation<br />
center of hands at the expected offset.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R120 Plasma Workspace</div></div></div><br /><div><strong>BRANCH</strong><div><div>fixclockshadowhandcenter</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D20112">https://phabricator.kde.org/D20112</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>applets/analog-clock/contents/ui/Hand.qml<br />
applets/analog-clock/contents/ui/analogclock.qml</div></div></div><br /><div><strong>To: </strong>kossebau, Plasma, VDG, mart, davidedmundson, ngraham<br /><strong>Cc: </strong>plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart<br /></div>