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:
@@ -61,6 +61,22 @@ template $GcalWeekView: Box {
|
||||
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 {
|
||||
Box content {
|
||||
orientation: horizontal;
|
||||
|
||||
Reference in New Issue
Block a user