Feature #560

Add themes to clock face, hands and overlay

Added by Hammel almost 2 years ago. Updated almost 2 years ago.

Status:ClosedStart date:16 Dec 2016
Priority:ImmediateDue date:
Assignee:Hammel% Done:

100%

Category:-
Target version:PiBox - 0.12.0
Severity:01 - Critical

Description

This is relatively easy although the rotation of the hands is a little confusing (to me, so far). But the background face and overlay (like adding a glass highlight) are straightforward.

How this needs to be done:
  • Add support for a theme directory
  • Add support for a current theme configuration, defaulting to original drawn face and hands
  • Design theme config file format, including validation of the content
    • Maximum face size: 512
    • Scale hands: face size * {.97 second, .85 minute, .65 hour}
    • Hands have rotation point: x/y offset for where rotation should occur
  • Write functions for loading hands and rotating them
  • If theme available, do drawing:
    • Draw background
    • Call hour hand, draw it
    • Call minute hand, draw it
    • Call second hand, draw it
    • Draw overlay
The hand functions have to
  • Be loaded into their own cairo surface
  • Scale the hand
  • Rotate the hand
  • position the hand after the call
  • merged into the main cairo surface

See http://zetcode.com/gfx/cairo/compositing/

Also see this for how to translate and rotate the hands: http://stackoverflow.com/a/35996791. Note that this also shows the use of a Cairo pattern that is generated from the source and is used for translating/rotating.

Associated revisions

Revision b2229eeb
Added by Hammel almost 2 years ago

RM #560: Initial test of themeing for piclock.

Revision b2229eeb
Added by Hammel almost 2 years ago

RM #560: Initial test of themeing for piclock.

Revision cf616b9e
Added by Hammel almost 2 years ago

RM #560: Get original clock working on F22 before continuing on to theme support.

Revision cf616b9e
Added by Hammel almost 2 years ago

RM #560: Get original clock working on F22 before continuing on to theme support.

Revision 63be9e6a
Added by Hammel almost 2 years ago

RM #560: Added hour hand overlay to clock face.

Revision 63be9e6a
Added by Hammel almost 2 years ago

RM #560: Added hour hand overlay to clock face.

Revision 97fb475b
Added by Hammel almost 2 years ago

RM #560: Fix the hour hand rotation to match the current hour.

Revision 97fb475b
Added by Hammel almost 2 years ago

RM #560: Fix the hour hand rotation to match the current hour.

Revision af9d0b6f
Added by Hammel almost 2 years ago

RM #560: Fix test theme hour hand to properly fit over its clock face.

Revision af9d0b6f
Added by Hammel almost 2 years ago

RM #560: Fix test theme hour hand to properly fit over its clock face.

Revision dd779162
Added by Hammel almost 2 years ago

RM #560: Clean up the test theme hands to fit better over the clock face.

Revision dd779162
Added by Hammel almost 2 years ago

RM #560: Clean up the test theme hands to fit better over the clock face.

Revision 36bb875d
Added by Hammel almost 2 years ago

RM #560: Abstract the hand drawing function so it works for any hand. Add in the minute and second hands.

Revision 36bb875d
Added by Hammel almost 2 years ago

RM #560: Abstract the hand drawing function so it works for any hand. Add in the minute and second hands.

Revision d5d886b5
Added by Hammel almost 2 years ago

RM #560: Add clock overlay (like a glass or plastic top) support.

Revision d5d886b5
Added by Hammel almost 2 years ago

RM #560: Add clock overlay (like a glass or plastic top) support.

Revision fe433fe8
Added by Hammel almost 2 years ago

RM #560: Add support for using an overlay image to place over the face and hands.

Revision fe433fe8
Added by Hammel almost 2 years ago

RM #560: Add support for using an overlay image to place over the face and hands.

Revision 0636dd40
Added by Hammel almost 2 years ago

RM #560: Comment updates explaining the theme configuration file format.

Revision 0636dd40
Added by Hammel almost 2 years ago

RM #560: Comment updates explaining the theme configuration file format.

Revision ba425890
Added by Hammel almost 2 years ago

RM #560: Added roman theme.

Revision ba425890
Added by Hammel almost 2 years ago

RM #560: Added roman theme.

Revision 71912ccb
Added by Hammel almost 2 years ago

RM #560: Fix packaging to include themes.

Revision 71912ccb
Added by Hammel almost 2 years ago

RM #560: Fix packaging to include themes.

Revision f916be34
Added by Hammel almost 2 years ago

RM #560: Clean out some unused code.

Revision f916be34
Added by Hammel almost 2 years ago

RM #560: Clean out some unused code.

History

#1 Updated by Hammel almost 2 years ago

  • % Done changed from 0 to 10

This code is going into the implement-themes branch until it's ready.

#2 Updated by Hammel almost 2 years ago

  • Description updated (diff)

#3 Updated by Hammel almost 2 years ago

  • % Done changed from 10 to 70

Implemented themes handling in piclock. It was actually much easier than I thought. I now have two themes: test and roman. The latter is the default. I need to test these on hardware now.

All code is checked into the implement-themes branch.

#4 Updated by Hammel almost 2 years ago

  • % Done changed from 70 to 100

Verified on hardware. Just needed a little packaging update.

Boom! Hoorah! Themes are added to piclock!

Closing issue.

#5 Updated by Hammel almost 2 years ago

  • Status changed from In Progress to Closed

Also available in: Atom PDF