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