summaryrefslogtreecommitdiff
path: root/wasp/apps/pager.py
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2021-01-10 10:34:37 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2021-01-10 10:34:37 (GMT)
commited242b84a6e70aff344669559c038348c822413a (patch)
treeb5b8857e5e84ef1a551444ee5be088eb9c496748 /wasp/apps/pager.py
parentb6b30238c6f714986f6b5a54a79bdb5672b534c1 (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.py10
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'