imageWindow: Fix shortcuts not always working

This commit is contained in:
Sophie Herold 2024-12-21 03:09:15 +01:00
parent bbf9534bdd
commit cb31b93ee1
5 changed files with 118 additions and 141 deletions

View file

@ -61,6 +61,9 @@ mod imp {
#[properties(wrapper_type = super::LpImageWindow)]
#[template(file = "image_window.ui")]
pub struct LpImageWindow {
#[template_child]
pub(super) shortcut_controller: TemplateChild<gtk::ShortcutController>,
#[template_child]
pub(super) headerbar: TemplateChild<adw::HeaderBar>,
#[template_child]
@ -140,7 +143,7 @@ mod imp {
);
// Set up actions
Action::init_actions_and_bindings(klass);
Action::init_actions(klass);
}
}
@ -153,6 +156,8 @@ mod imp {
let obj = self.obj();
Action::add_bindings(&obj);
self.forward_click_gesture.connect_pressed(glib::clone!(
#[weak]
obj,