summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-12-13 16:46:19 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-12-13 16:51:07 (GMT)
commit4468285c343d7f4044748c6232f3e7510def9dce (patch)
tree6e56a34216bd39af04f7d8b9f81d8b66bcb0120c
parente44e605b7a2dd09e7d07c85ca1a73c5ce5b6d92b (diff)
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>
-rw-r--r--tools/test_theme.py2
-rwxr-xr-xtools/themer.py4
-rw-r--r--wasp/wasp.py2
-rw-r--r--wasp/widgets.py5
4 files changed, 7 insertions, 6 deletions
diff --git a/tools/test_theme.py b/tools/test_theme.py
index dc2b990..2c161ff 100644
--- a/tools/test_theme.py
+++ b/tools/test_theme.py
@@ -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
diff --git a/tools/themer.py b/tools/themer.py
index 819c35c..f0f1f35 100755
--- a/tools/themer.py
+++ b/tools/themer.py
@@ -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),
diff --git a/wasp/wasp.py b/wasp/wasp.py
index 4837e12..2422cfd 100644
--- a/wasp/wasp.py
+++ b/wasp/wasp.py
@@ -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",
diff --git a/wasp/widgets.py b/wasp/widgets.py
index 1d79e22..d39de90 100644
--- a/wasp/widgets.py
+++ b/wasp/widgets.py
@@ -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)