diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2021-01-10 10:34:37 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2021-01-10 10:34:37 (GMT) |
| commit | ed242b84a6e70aff344669559c038348c822413a (patch) | |
| tree | b5b8857e5e84ef1a551444ee5be088eb9c496748 /wasp/apps/pager.py | |
| parent | b6b30238c6f714986f6b5a54a79bdb5672b534c1 (diff) | |
widgets: ConfirmationView: Adopt the button widget
Replace the pixelated Yes/No buttons with text based alternatives.
This also required changes to the pager to change the way the
redraw after changing view is implemented (improved muting and a reset
of the colours).
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/apps/pager.py')
| -rw-r--r-- | wasp/apps/pager.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/wasp/apps/pager.py b/wasp/apps/pager.py index 4f518eb..5a435a6 100644 --- a/wasp/apps/pager.py +++ b/wasp/apps/pager.py @@ -36,8 +36,6 @@ class PagerApp(): def swipe(self, event): """Swipe to page up/down.""" - mute = wasp.watch.display.mute - if event[0] == wasp.EventType.UP: if self._page >= self._numpages: wasp.system.navigate(wasp.EventType.BACK) @@ -48,9 +46,7 @@ class PagerApp(): wasp.watch.vibrator.pulse() return self._page -= 1 - mute(True) self._draw() - mute(False) def _redraw(self): """Redraw from scratch (jump to the first page)""" @@ -61,7 +57,11 @@ class PagerApp(): def _draw(self): """Draw a page from scratch.""" + mute = wasp.watch.display.mute draw = wasp.watch.drawable + + mute(True) + draw.set_color(0xffff) draw.fill() page = self._page @@ -77,6 +77,8 @@ class PagerApp(): scroll.down = page < self._numpages scroll.draw() + mute(False) + class NotificationApp(PagerApp): NAME = 'Notifications' |
