Scroll long menus and lists with the mouse wheel or a swipe

Touch clicks in menus happen on release without a swipe. The first-start
language picker is a flag grid that scrolls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-05 16:04:20 +01:00
1 parent d8e9184a9c
commit 6629472811
4 files changed
+157 -25

No files matched your search

+10
View File
@@ -92,6 +92,16 @@ impl Menu {
self.page = Some(page);
}
// mouse wheel / swipe: the previous or next entry (no wrap-around)
pub(super) fn bestiary_wheel(&mut self, d: i32) {
let Some(Page::Bestiary { tab, sel, .. }) = self.page else { return };
let n = entries(tab).len() as i32;
let s = sel as i32 + d;
if s >= 0 && s < n {
self.bestiary_click(Btn::BestSel(d));
}
}
pub(super) fn draw_bestiary(&mut self, gfx: &Gfx, tab: usize, sel: usize, level: u32) {
let (sw, sh) = (sw(), sh());
let (mx, my) = mouse();