Skip to content

Commit 70e3de6

Browse files
Merge pull request #67 from PausedByPaul/fix/menu-scroll-backward
Add support for scrolling backward from Page 1 when there are multiple pages
2 parents 982b1db + c29b6e2 commit 70e3de6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

badge/apps/menu/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ def update():
8888
icons = load_page_icons(current_page)
8989
active = 0
9090
else:
91-
# Wrap to beginning
91+
# Wrap to beginning (first page, first icon)
92+
current_page = 0
93+
icons = load_page_icons(current_page)
9294
active = 0
9395
elif active < 0:
9496
if current_page > 0:
@@ -97,7 +99,9 @@ def update():
9799
icons = load_page_icons(current_page)
98100
active = len(icons) - 1
99101
else:
100-
# Wrap to end
102+
# Wrap to last page, last icon
103+
current_page = total_pages - 1
104+
icons = load_page_icons(current_page)
101105
active = len(icons) - 1
102106

103107
# Launch app with error handling

0 commit comments

Comments
 (0)