misc: Be consistent for setting the key binding to close dialogs
This commit is contained in:
parent
654ef1b4e6
commit
a4bd482e8c
|
@ -24,10 +24,10 @@ mod imp {
|
|||
fn class_init(klass: &mut Self::Class) {
|
||||
Self::bind_template(klass);
|
||||
|
||||
klass.add_binding_signal(
|
||||
klass.add_binding_action(
|
||||
gdk::Key::Escape,
|
||||
gdk::ModifierType::empty(),
|
||||
"close-request",
|
||||
"window.close",
|
||||
None,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -30,6 +30,13 @@ mod imp {
|
|||
fn class_init(klass: &mut Self::Class) {
|
||||
Self::bind_template(klass);
|
||||
|
||||
klass.add_binding_action(
|
||||
gdk::Key::Escape,
|
||||
gdk::ModifierType::empty(),
|
||||
"window.close",
|
||||
None,
|
||||
);
|
||||
|
||||
klass.install_action("attachment-dialog.send", None, move |window, _, _| {
|
||||
window.imp().send.set(true);
|
||||
window.emit_by_name::<()>("send", &[]);
|
||||
|
|
|
@ -35,15 +35,5 @@
|
|||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<child>
|
||||
<object class="GtkShortcutController">
|
||||
<child>
|
||||
<object class="GtkShortcut">
|
||||
<property name="trigger">Escape</property>
|
||||
<property name="action">action(window.close)</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
|
|
|
@ -42,13 +42,10 @@ mod imp {
|
|||
Self::bind_template(klass);
|
||||
Self::Type::bind_template_callbacks(klass);
|
||||
|
||||
klass.add_binding(
|
||||
klass.add_binding_action(
|
||||
gdk::Key::Escape,
|
||||
gdk::ModifierType::empty(),
|
||||
|obj, _| {
|
||||
obj.close();
|
||||
true
|
||||
},
|
||||
"window.close",
|
||||
None,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -31,13 +31,10 @@ mod imp {
|
|||
Self::bind_template(klass);
|
||||
Self::Type::bind_template_callbacks(klass);
|
||||
|
||||
klass.add_binding(
|
||||
klass.add_binding_action(
|
||||
gdk::Key::Escape,
|
||||
gdk::ModifierType::empty(),
|
||||
|obj, _| {
|
||||
obj.close();
|
||||
true
|
||||
},
|
||||
"window.close",
|
||||
None,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -65,13 +65,10 @@ mod imp {
|
|||
Self::bind_template(klass);
|
||||
Self::Type::bind_template_callbacks(klass);
|
||||
|
||||
klass.add_binding(
|
||||
klass.add_binding_action(
|
||||
gdk::Key::Escape,
|
||||
gdk::ModifierType::empty(),
|
||||
|obj, _| {
|
||||
obj.close();
|
||||
true
|
||||
},
|
||||
"window.close",
|
||||
None,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue