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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user