[Desktop Theme KCM] Adapt clock to new hand rotation center options
ClosedPublic

Authored by kossebau on Mar 29 2019, 12:11 PM.

Details

Summary

The new hints

  • hint-hourhand-rotation-center-offset
  • hint-minutehand-rotation-center-offset

allow themes to define where in the hand pixmap the rotation center should
be placed.

Test Plan

Clear the cache (rm .cache/plasma* -r) and restart system settings, see
clocks of unmodified themes still have hands at normal position, and hands
of modified themes at expected positions.

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Mar 29 2019, 12:11 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 29 2019, 12:11 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kossebau requested review of this revision.Mar 29 2019, 12:11 PM
kossebau added a comment.EditedMar 29 2019, 12:15 PM

See D20112 for the same change for the applet.

To test, you can download the Unicorn theme from store.kde.org, then edit the .local/share/plasma/desktoptheme/unicorn/widgets/clock.svg and append this before the final </svg>:

  <rect
       style="opacity:0.875;fill:#008000;fill-opacity:1;stroke:none"
       id="hint-hands-shadow-offset-to-west"
       width="20"
       height="4"
       x="100"
       y="60" />
  <rect
       style="opacity:0.875;fill:#008000;fill-opacity:1;stroke:none"
       id="hint-hands-shadow-offset-to-south"
       width="4"
       height="10"
       x="110"
       y="60" />
<!-- Updated: initial code variant
  <rect
       style="opacity:0.875;fill:#008000;fill-opacity:1;stroke:none"
       id="hint-hourhand-rotation-center-offset"
       width="7.4285"
       height="2.5"
       x="93.071"
       y="70" />
  <rect
       style="opacity:0.875;fill:#008000;fill-opacity:1;stroke:none"
       id="hint-minutehand-rotation-center-offset"
       width="37.835"
       height="2.5"
       x="62.576"
       y="80" />
  <rect
       style="opacity:0.875;fill:#008000;fill-opacity:1;stroke:none"
       id="hint-secondhand-rotation-center-offset"
       width="11,772"
       height="0.5"
       x="88.616"
       y="90" />
-->
  <circle
       style="opacity:0.875;fill:#008000;fill-opacity:1;stroke:none"
       id="hint-hourhand-rotation-center-offset"
       r="2"
       cx="100"
       cy="100" />
  <circle
       style="opacity:0.875;fill:#008000;fill-opacity:1;stroke:none"
       id="hint-minutehand-rotation-center-offset"
       r="2"
       cx="100"
       cy="100" />
  <circle
       style="opacity:0.875;fill:#008000;fill-opacity:1;stroke:none"
       id="hint-secondhand-rotation-center-offset"
       r="2"
       cx="100"
       cy="100" />

Clearing the cache and then reloading the theme settings will then fix the Unicorn clock to look like this (minute hand properly rotated around end) as well keep the other clocks unchanged:

mart accepted this revision.Apr 1 2019, 10:44 AM
This revision is now accepted and ready to land.Apr 1 2019, 10:44 AM
ngraham accepted this revision.Apr 1 2019, 1:01 PM

Very nice work!

kossebau updated this revision to Diff 55781.Apr 8 2019, 8:54 PM

Adapt to latest proposal in D20112

This revision was automatically updated to reflect the committed changes.