mirror of
https://gitlab.gnome.org/World/Authenticator.git
synced 2025-03-04 08:44:40 +01:00
Merge branch 'wip/cdavis/use-shortcuts' into 'master'
Use GtkShortcut instead of GtkEventControllerKey See merge request World/Authenticator!170
This commit is contained in:
commit
5ab811ddf2
4 changed files with 22 additions and 22 deletions
|
@ -221,6 +221,17 @@
|
|||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class='GtkShortcutController'>
|
||||
<property name='scope'>global</property>
|
||||
<child>
|
||||
<object class='GtkShortcut'>
|
||||
<property name='trigger'>Escape</property>
|
||||
<property name='action'>action(window.close)</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
<object class="GtkEntryCompletion" id="provider_completion">
|
||||
<property name="minimum-key-length">1</property>
|
||||
|
|
|
@ -76,5 +76,16 @@
|
|||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class='GtkShortcutController'>
|
||||
<property name='scope'>global</property>
|
||||
<child>
|
||||
<object class='GtkShortcut'>
|
||||
<property name='trigger'>Escape</property>
|
||||
<property name='action'>action(window.close)</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
|
|
|
@ -136,17 +136,6 @@ impl AccountAddDialog {
|
|||
self_
|
||||
.token_entry
|
||||
.connect_changed(clone!(@weak self as win => move |_| win.validate()));
|
||||
|
||||
let event_controller = gtk::EventControllerKey::new();
|
||||
event_controller.connect_key_pressed(
|
||||
clone!(@weak self as widget => @default-return Inhibit(false), move |_, k, _, _| {
|
||||
if k == gdk::keys::Key::from_name("Escape") {
|
||||
widget.close();
|
||||
}
|
||||
Inhibit(false)
|
||||
}),
|
||||
);
|
||||
self.add_controller(&event_controller);
|
||||
}
|
||||
|
||||
fn scan_qr(&self) -> Result<()> {
|
||||
|
|
|
@ -144,17 +144,6 @@ impl ProvidersDialog {
|
|||
|
||||
let deck_page = self_.deck.append(&self_.page).unwrap();
|
||||
deck_page.set_name("provider");
|
||||
|
||||
let event_controller = gtk::EventControllerKey::new();
|
||||
event_controller.connect_key_pressed(
|
||||
clone!(@weak self as widget => @default-return Inhibit(false), move |_, k, _, _| {
|
||||
if k == gdk::keys::Key::from_name("Escape") {
|
||||
widget.close();
|
||||
}
|
||||
Inhibit(false)
|
||||
}),
|
||||
);
|
||||
self.add_controller(&event_controller);
|
||||
}
|
||||
|
||||
fn setup_actions(&self) {
|
||||
|
|
Loading…
Add table
Reference in a new issue