1
0
Fork 0

widgets: BatteryMeter: Fix theme handling

Add the battery frame to the theme so it matches the frame used for
charging and rename accordingly.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
testbuild
Daniel Thompson 2020-12-13 16:46:19 +00:00
parent e44e605b7a
commit 4468285c34
4 changed files with 7 additions and 6 deletions

View File

@ -6,7 +6,7 @@ class Theme(DefaultTheme):
# The default theme was generated by removing all the lines below and adding `pass` instead.
BLE_COLOR = 0xfb80
SCROLL_INDICATOR_COLOR = 0xf800
BATTERY_CHARGING_COLOR = 0x07ff
BATTERY_COLOR = 0x07ff
SMALL_CLOCK_COLOR = 0x599f
NOTIFICATION_COLOR = 0x8fe0
ACCENT_MID = 0xf800

View File

@ -14,7 +14,7 @@ class DefaultTheme():
"""
BLE_COLOR = 0x7bef
SCROLL_INDICATOR_COLOR = 0x7bef
BATTERY_CHARGING_COLOR = 0x7bef
BATTERY_COLOR = 0x7bef
SMALL_CLOCK_COLOR = 0xe73c
NOTIFICATION_COLOR = 0x7bef
ACCENT_MID = 0xb5b6
@ -29,7 +29,7 @@ class DefaultTheme():
theme_bytes = bytes([
*split_bytes(self.BLE_COLOR),
*split_bytes(self.SCROLL_INDICATOR_COLOR),
*split_bytes(self.BATTERY_CHARGING_COLOR),
*split_bytes(self.BATTERY_COLOR),
*split_bytes(self.SMALL_CLOCK_COLOR),
*split_bytes(self.NOTIFICATION_COLOR),
*split_bytes(self.ACCENT_MID),

View File

@ -529,7 +529,7 @@ class Manager():
"""Returns the relevant part of theme. For more see ../tools/themer.py"""
theme_parts = ("ble",
"scroll-indicator",
"battery-charging",
"battery",
"status-clock",
"notify-icon",
"accent-mid",

View File

@ -40,7 +40,7 @@ class BatteryMeter:
if watch.battery.charging():
if self.level != -1:
draw.rleblit(icon, pos=(239-icon[0], 0),
fg=wasp.system.theme('battery-charging'))
fg=wasp.system.theme('battery'))
self.level = -1
else:
level = watch.battery.level()
@ -59,7 +59,8 @@ class BatteryMeter:
if self.level < 0 or ((level > 5) ^ (self.level > 5)):
if level > 5:
draw.rleblit(icon, pos=(239-icon[0], 0), fg=0x7bef)
draw.rleblit(icon, pos=(239-icon[0], 0),
fg=wasp.system.theme('battery'))
else:
rgb = 0xf800
draw.rleblit(icon, pos=(239-icon[0], 0), fg=0xf800)