week-view: explicitly handle PgUp/PgDown via ShortcutController

ScrolledWindow handles PgUp/PgDown in bubble phase to trigger scrolling.
Which leads to inconsistent behaviour: scrolling when an event is focused,
and moving to the previous/next week when not. Explicitly handling the
shortcuts with a ShortcutController in capture phase makes it consistently
navigate to previous/next week.

Fixes #1409

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/618>
This commit is contained in:
Emma Blink
2025-07-27 16:23:40 +01:00
parent d477ac2d72
commit fbc181743b
+16
View File
@@ -61,6 +61,22 @@ template $GcalWeekView: Box {
leave => $on_motion_controller_leave_cb(template) not-swapped; leave => $on_motion_controller_leave_cb(template) not-swapped;
} }
// Make the behaviour of Page-Up/Page-Down consistent regardless of
// whether an event is selected in the week view.
ShortcutController {
propagation-phase: capture;
Shortcut {
trigger: "Page_Up";
action: "action(win.previous-date)";
}
Shortcut {
trigger: "Page_Down";
action: "action(win.next-date)";
}
}
Viewport { Viewport {
Box content { Box content {
orientation: horizontal; orientation: horizontal;