summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2023-02-11 23:51:32 +0100
committerNiels De Graef <nielsdegraef@gmail.com>2023-02-12 09:22:09 +0000
commitcf0987c7dab429c86f3295c440dbfd0ad957c406 (patch)
tree8b9948feb5c4edebb3a42449fcc68109d22b9b7b /data
parent34869e2f15844bee8938df2a4ccde14fbe662e2b (diff)
downloadgnome-contacts-cf0987c7dab429c86f3295c440dbfd0ad957c406.tar.gz
Add shortcuts for saving/canceling contact edit
Allow saving a contact by pressing `<Ctrl>Enter` or cancelling by pressing `Escape`.
Diffstat (limited to 'data')
-rw-r--r--data/gtk/help-overlay.ui17
-rw-r--r--data/ui/contacts-main-window.ui18
2 files changed, 31 insertions, 4 deletions
diff --git a/data/gtk/help-overlay.ui b/data/gtk/help-overlay.ui
index f847085..b7ab13a 100644
--- a/data/gtk/help-overlay.ui
+++ b/data/gtk/help-overlay.ui
@@ -49,6 +49,23 @@
</child>
</object>
</child>
+ <child>
+ <object class="GtkShortcutsGroup">
+ <property name="title" translatable="yes" context="shortcut window">Editing or creating a contact</property>
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property name="accelerator">&lt;Control&gt;Return</property>
+ <property name="title" translatable="yes" context="shortcut window">Save current changes to contact</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property name="accelerator">Escape</property>
+ <property name="title" translatable="yes" context="shortcut window">Cancel current changes for contact</property>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
</child>
</object>
diff --git a/data/ui/contacts-main-window.ui b/data/ui/contacts-main-window.ui
index d40f2f4..206d172 100644
--- a/data/ui/contacts-main-window.ui
+++ b/data/ui/contacts-main-window.ui
@@ -79,6 +79,18 @@
<property name="action">action(win.focus-search)</property>
</object>
</child>
+ <child>
+ <object class="GtkShortcut">
+ <property name="trigger">Escape</property>
+ <property name="action">action(win.edit-contact-cancel)</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkShortcut">
+ <property name="trigger">&lt;Control&gt;Return</property>
+ <property name="action">action(win.edit-contact-save)</property>
+ </object>
+ </child>
</object>
</child>
@@ -270,8 +282,7 @@
<property name="label" translatable="yes">_Cancel</property>
<property name="use_underline">True</property>
<signal name="notify::visible" handler="on_cancel_visible" object="ContactsMainWindow" after="yes" swapped="no"/>
- <property name="action-name">win.stop-editing-contact</property>
- <property name="action-target">true</property>
+ <property name="action-name">win.edit-contact-cancel</property>
</object>
</child>
<child type="end">
@@ -302,8 +313,7 @@
<property name="use_underline">True</property>
<property name="label" translatable="yes">Done</property>
<property name="valign">center</property>
- <property name="action-name">win.stop-editing-contact</property>
- <property name="action-target">false</property>
+ <property name="action-name">win.edit-contact-save</property>
<style>
<class name="suggested-action"/>
</style>