diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-12-30 10:29:02 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2020-12-30 10:29:02 (GMT) |
| commit | b8ba1a9eba84f8bdcb9ca5dd992c64e40a17eabe (patch) | |
| tree | 49b709d4673c426129b36b7d236423dc18c27bab /wasp/apps | |
| parent | 116c138079798ab0b4cf2e689b2e842ce4d07927 (diff) | |
widgets: ConfirmationView: Fix hit box problems
The ConfirmationView became broken when we converted it's images over to
2-bit RLE. That happened because the confirmation view relied on the
the 1-bit RLE to dynamically generate hit boxes.
Currently the code pre-calculates the hit box which is a waste of RAM.
Let's rip out the existing hit box logic and replace it with much larger
("fat finger") hit targets.
We make the touch() method more closely adopt the idioms of other UI
components (e.g. don't return the dialog status... just whether or
not we handled the touch).
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/apps')
| -rw-r--r-- | wasp/apps/pager.py | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/wasp/apps/pager.py b/wasp/apps/pager.py index 2f74d0e..4f518eb 100644 --- a/wasp/apps/pager.py +++ b/wasp/apps/pager.py @@ -106,28 +106,19 @@ class NotificationApp(PagerApp): return else: if event[0] == wasp.EventType.DOWN and self._page == 0: - self.confirmation_view.active = True - self._draw() + self.confirmation_view.draw('Clear notifications?') return super().swipe(event) - def _draw(self): - if self.confirmation_view.active: - self.confirmation_view.draw('Clear notifications?') - else: - super()._draw() - def touch(self, event): - if self.confirmation_view.active: - is_confirmed = self.confirmation_view.touch(event) - if is_confirmed: + if self.confirmation_view.touch(event): + if self.confirmation_view.value: wasp.system.notifications = {} wasp.system.navigate(wasp.EventType.BACK) - elif is_confirmed != None: + else: self._draw() - class CrashApp(): """Crash handler application. |
