diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-04-05 08:48:03 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-04-06 21:04:21 (GMT) |
| commit | 2b5ebcef727af5d99ebaee224545510b668d63ae (patch) | |
| tree | e9f084497ff8a4a041a38fd830d62f862bd32040 /wasp/widgets.py | |
| parent | bb4e76d85222c263c4486ad1722df44200fcabf2 (diff) | |
wasp: widgets: Add a scrolling indicator
As we enrich the navigation options we will increasinly need to visualize
between apps where up/down will switch us between rings and there
up/down is needed to scroll through content.
Diffstat (limited to 'wasp/widgets.py')
| -rw-r--r-- | wasp/widgets.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/wasp/widgets.py b/wasp/widgets.py index aac56da..9aa39a0 100644 --- a/wasp/widgets.py +++ b/wasp/widgets.py @@ -11,7 +11,7 @@ class BatteryMeter(object): def draw(self): self.level = -2 self.update() - + def update(self): icon = icons.battery draw = watch.drawable @@ -50,3 +50,19 @@ class BatteryMeter(object): draw.fill(rgb, x, 38 - h, w, h) self.level = level + +class ScrollIndicator(): + def __init__(self, x=240-18, y=240-24): + self._pos = (x, y) + self.up = True + self.down = True + + def draw(self): + self.update() + + def update(self): + draw = watch.drawable + if self.up: + draw.rleblit(icons.up_arrow, pos=self._pos, fg=0x7bef) + if self.down: + draw.rleblit(icons.down_arrow, pos=(self._pos[0], self._pos[1] + 13), fg=0x7bef) |
