calendar-list: move previous/next week with PgUp/PgDown via ShortcutController
Currently, clicking on a calendar in the sidebar's listbox traps
the keyboard focus. As a result, pressing PageUp or PageDown
scrolls the listbox instead of switching the date.
Similar to commit fbc18174 for the week view, this adds a
capture-phase ShortcutController to the calendar listbox. This
ensures that PgUp and PgDown consistently switch month or week
regardless of whether a calendar item is focused.
Fixes #1593
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/771>
This commit is contained in:
@@ -15,6 +15,21 @@ template $GcalCalendarList: Adw.Bin {
|
|||||||
hexpand: true;
|
hexpand: true;
|
||||||
selection-mode: none;
|
selection-mode: none;
|
||||||
row-activated => $on_listbox_row_activated_cb(template) not-swapped;
|
row-activated => $on_listbox_row_activated_cb(template) not-swapped;
|
||||||
|
// Allow Page-Up/Page-Down to consistently switch months/weeks,
|
||||||
|
// regardless of whether the sidebar's calendars listbox has focus.
|
||||||
|
ShortcutController {
|
||||||
|
propagation-phase: capture;
|
||||||
|
|
||||||
|
Shortcut {
|
||||||
|
trigger: "Page_Up";
|
||||||
|
action: "action(win.previous-date)";
|
||||||
|
}
|
||||||
|
|
||||||
|
Shortcut {
|
||||||
|
trigger: "Page_Down";
|
||||||
|
action: "action(win.next-date)";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
styles [
|
styles [
|
||||||
"navigation-sidebar",
|
"navigation-sidebar",
|
||||||
|
|||||||
Reference in New Issue
Block a user