diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-12-13 16:39:29 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-12-13 16:51:07 (GMT) |
| commit | e44e605b7a2dd09e7d07c85ca1a73c5ce5b6d92b (patch) | |
| tree | f667c98d98c81f123502c0a8fc2082beefb0a394 | |
| parent | 2624a6e998f7b5a78a38fa98be15bf3d25ed81a9 (diff) | |
apps: clock: Fix theme handling
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
| -rw-r--r-- | wasp/apps/clock.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/wasp/apps/clock.py b/wasp/apps/clock.py index c062d3e..2d5e30e 100644 --- a/wasp/apps/clock.py +++ b/wasp/apps/clock.py @@ -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) |
