diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-07-24 16:04:46 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-07-24 16:04:46 (GMT) |
| commit | 326e06bc6bda0abf02372c8f23f7c9e60cd5cfff (patch) | |
| tree | 5ad634f403a0ebf1a9b441dae41b415d66e18b90 /wasp/widgets.py | |
| parent | a01fb7df573e13a6f6b9fbf2e7688d4e9713df6d (diff) | |
StatusBar: Rename and add BLE connection status icon
Notifier was a dumb name so make it better. Now that we have a decent
name it should be obvious how to handle the BLE connection status icon!
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/widgets.py')
| -rw-r--r-- | wasp/widgets.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/wasp/widgets.py b/wasp/widgets.py index 2fcac9e..7d30993 100644 --- a/wasp/widgets.py +++ b/wasp/widgets.py @@ -70,8 +70,8 @@ class BatteryMeter: self.level = level -class Notifier: - """Show if there are pending notifications.""" +class StatusBar: + """Show BT status and if there are pending notifications.""" def __init__(self, x=8, y=8): self._pos = (x, y) @@ -85,16 +85,21 @@ class Notifier: def update(self): """Update the widget. - - For this simple widget :py:meth:~.update` does nothing! """ draw = watch.drawable (x, y) = self._pos - if wasp.system.notifications: + if wasp.watch.connected(): + draw.blit(icons.blestatus, x, y, fg=0x7bef) + if wasp.system.notifications: + draw.blit(icons.notification, x+24, y, fg=0x7bef) + else: + draw.fill(0, x+24, y, 32, 32) + elif wasp.system.notifications: draw.blit(icons.notification, x, y, fg=0x7bef) + draw.fill(0, x+32, y, 32, 32) else: - draw.fill(0, x, y, 32, 32) + draw.fill(0, x, y, 56, 32) class ScrollIndicator: """Scrolling indicator. |
