apps: software: Fix some scrolling bugs
Currently the number of pages is (acidentally) hardcoded where it need not be and the scroll directions aren't right as soon as we go beyond two pages (where scroll up and down are equivalent actions). Fix both. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
parent
79db167ed9
commit
62288cc81e
1 changed files with 3 additions and 3 deletions
|
@ -47,10 +47,10 @@ class SoftwareApp():
|
|||
def swipe(self, event):
|
||||
"""Notify the application of a touchscreen swipe event."""
|
||||
page = self.page
|
||||
pages = 1
|
||||
if event[0] == wasp.EventType.UP:
|
||||
page = page - 1 if page > 0 else pages
|
||||
pages = (len(self.db)-1) // 5
|
||||
if event[0] == wasp.EventType.DOWN:
|
||||
page = page - 1 if page > 0 else pages
|
||||
if event[0] == wasp.EventType.UP:
|
||||
page = page + 1 if page < pages else 0
|
||||
self.page = page
|
||||
|
||||
|
|
Loading…
Reference in a new issue