apps: clock: Fix theme handling
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
parent
2624a6e998
commit
e44e605b7a
1 changed files with 9 additions and 10 deletions
|
@ -70,14 +70,16 @@ class ClockApp():
|
|||
True then a full redraw is be performed.
|
||||
"""
|
||||
draw = wasp.watch.drawable
|
||||
hi = wasp.system.theme('accent-hi')
|
||||
mid = wasp.system.theme('accent-mid')
|
||||
lo = wasp.system.theme('accent-lo')
|
||||
|
||||
if redraw:
|
||||
now = wasp.watch.rtc.get_localtime()
|
||||
|
||||
# Clear the display and draw that static parts of the watch face
|
||||
draw.fill()
|
||||
draw.rleblit(digits.clock_colon, pos=(2*48, 80),
|
||||
fg=wasp.system.theme('accent-mid'))
|
||||
draw.rleblit(digits.clock_colon, pos=(2*48, 80), fg=mid)
|
||||
|
||||
# Redraw the status bar
|
||||
wasp.system.bar.draw()
|
||||
|
@ -96,14 +98,11 @@ class ClockApp():
|
|||
month = MONTH[month*3:(month+1)*3]
|
||||
|
||||
# Draw the changeable parts of the watch face
|
||||
draw.rleblit(DIGITS[now[4] % 10], pos=(4*48, 80),
|
||||
fg=wasp.system.theme('accent-hi'))
|
||||
draw.rleblit(DIGITS[now[4] // 10], pos=(3*48, 80),
|
||||
fg=wasp.system.theme('accent-lo'))
|
||||
draw.rleblit(DIGITS[now[3] % 10], pos=(1*48, 80),
|
||||
fg=wasp.system.theme('accent-hi'))
|
||||
draw.rleblit(DIGITS[now[3] // 10], pos=(0*48, 80),
|
||||
fg=wasp.system.theme('accent-lo'))
|
||||
draw.rleblit(DIGITS[now[4] % 10], pos=(4*48, 80), fg=hi)
|
||||
draw.rleblit(DIGITS[now[4] // 10], pos=(3*48, 80), fg=lo)
|
||||
draw.rleblit(DIGITS[now[3] % 10], pos=(1*48, 80), fg=hi)
|
||||
draw.rleblit(DIGITS[now[3] // 10], pos=(0*48, 80), fg=lo)
|
||||
draw.set_color(hi)
|
||||
draw.string('{} {} {}'.format(now[2], month, now[0]),
|
||||
0, 180, width=240)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue