[xdg-desktop-portal-gnome/gbsneto/close-escape: 5/5] project: Bind Escape key to window.close action




commit d588e10d3da0ab252b9f1dd30d2cee3e9436ae4e
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Oct 7 14:41:57 2022 -0300

    project: Bind Escape key to window.close action
    
    Title, basically. Not much else to say, this is just the expected
    reaction to pressing Esc on dialogs.
    
    Closes
    https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/issues/59

 src/accountdialog.ui       | 11 +++++++++++
 src/remotedesktopdialog.ui | 12 ++++++++++++
 src/screencastdialog.ui    | 12 ++++++++++++
 src/screenshotdialog.ui    | 12 ++++++++++++
 src/wallpaperdialog.ui     | 12 ++++++++++++
 5 files changed, 59 insertions(+)
---
diff --git a/src/accountdialog.ui b/src/accountdialog.ui
index 581e9c3..90ab75f 100644
--- a/src/accountdialog.ui
+++ b/src/accountdialog.ui
@@ -4,6 +4,17 @@
     <property name="title" translatable="yes">Share Details</property>
     <property name="resizable">0</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>
+
     <child type="titlebar">
       <object class="GtkHeaderBar" id="titlebar">
         <property name="show-title-buttons">False</property>
diff --git a/src/remotedesktopdialog.ui b/src/remotedesktopdialog.ui
index c0b0b9f..3a1a181 100644
--- a/src/remotedesktopdialog.ui
+++ b/src/remotedesktopdialog.ui
@@ -5,6 +5,18 @@
     <property name="default-width">500</property>
     <property name="default-height">300</property>
     <property name="title" translatable="yes">Remote desktop</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>
+
     <child type="titlebar">
       <object class="GtkHeaderBar" id="titlebar">
         <property name="show-title-buttons">0</property>
diff --git a/src/screencastdialog.ui b/src/screencastdialog.ui
index 14751fd..9ee9ca4 100644
--- a/src/screencastdialog.ui
+++ b/src/screencastdialog.ui
@@ -6,6 +6,18 @@
     <property name="resizable">0</property>
     <property name="default-width">500</property>
     <property name="default-height">300</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>
+
     <child type="titlebar">
       <object class="GtkHeaderBar" id="titlebar">
         <property name="show-title-buttons">false</property>
diff --git a/src/screenshotdialog.ui b/src/screenshotdialog.ui
index cafc467..303947b 100644
--- a/src/screenshotdialog.ui
+++ b/src/screenshotdialog.ui
@@ -6,6 +6,18 @@
     <property name="default-width">500</property>
     <property name="default-height">400</property>
     <property name="title" translatable="yes">Screenshot</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>
+
     <child type="titlebar">
       <object class="GtkHeaderBar" id="titlebar">
         <property name="show-title-buttons">false</property>
diff --git a/src/wallpaperdialog.ui b/src/wallpaperdialog.ui
index 61af17c..33ac991 100644
--- a/src/wallpaperdialog.ui
+++ b/src/wallpaperdialog.ui
@@ -6,6 +6,18 @@
     <property name="default-height">300</property>
     <property name="modal">1</property>
     <property name="title" translatable="yes">Set Background</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>
+
     <child type="titlebar">
       <object class="GtkHeaderBar">
         <property name="show-title-buttons">0</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]