window: Go back/forth views using hardware buttons

Refactor `on_window_previous_date_activated_cb` and
`on_window_next_date_activated_cb` into separate methods for going to
the prev/next view, to be used in the callbacks for both the
forward/back buttons in the UI, and for the `Gtk.GestureClick` callbacks
that listens for the hardware buttons to be pressed.

Closes: https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/1494
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/682>
This commit is contained in:
Zoey Ahmed
2026-01-15 17:02:17 +00:00
parent 6270b5938f
commit c3635967bc
2 changed files with 61 additions and 18 deletions
+10
View File
@@ -105,6 +105,16 @@ template $GcalWindow: Adw.ApplicationWindow {
}
}
GestureClick {
button: 8; // Hardware back button.
pressed => $on_back_button_pressed_cb(template) not-swapped;
}
GestureClick {
button: 9; // Hardware forward button.
pressed => $on_forward_button_pressed_cb(template) not-swapped;
}
Adw.ToastOverlay overlay {
$GcalDropOverlay drop_overlay {
overlayed: Adw.StatusPage drop_status_page {