[gnome-logs/wip/shortcuts] Use GtkShortcutsWindow



commit 2f343d474c434beec7cec68a39d86f8cc7ce12fc
Author: David King <davidk gnome org>
Date:   Tue Dec 8 17:37:06 2015 +0000

    Use GtkShortcutsWindow

 configure.ac                      |    2 +-
 data/help-overlay.ui              |   42 +++++++++++++++++++++++++++++++++++++
 data/menus.ui                     |    4 +++
 data/org.gnome.Logs.gresource.xml |    1 +
 4 files changed, 48 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 10f0b31..bc5dae9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,7 +100,7 @@ AM_CONDITIONAL([LOGS_ENABLE_TESTS], [test "x$testing_utilities" = "xyes"])
 
 dnl Libraries
 GIO_REQUIRED="gio-unix-2.0 >= 2.43.90"
-GTK_REQUIRED="gtk+-3.0 >= 3.15.7"
+GTK_REQUIRED="gtk+-3.0 >= 3.19.3"
 SYSTEMD_REQUIRED="libsystemd"
 PKG_CHECK_MODULES([LOGS], [$GIO_REQUIRED $GTK_REQUIRED $SYSTEMD_REQUIRED])
 
diff --git a/data/help-overlay.ui b/data/help-overlay.ui
new file mode 100644
index 0000000..68dd94c
--- /dev/null
+++ b/data/help-overlay.ui
@@ -0,0 +1,42 @@
+<interface domain="gnome-logs">
+    <object class="GtkShortcutsWindow" id="help_overlay">
+        <child>
+            <object class="GtkShortcutsSection">
+                <property name="visible">True</property>
+                <child>
+                    <object class="GtkShortcutsGroup">
+                        <property name="name" translatable="yes">General</property>
+                        <property name="visible">True</property>
+                        <child>
+                            <object class="GtkShortcutsShortcut">
+                                <property name="accelerator">&lt;Primary&gt;n</property>
+                                <property name="title" translatable="yes">Open a new window</property>
+                                <property name="visible">True</property>
+                            </object>
+                        </child>
+                        <child>
+                            <object class="GtkShortcutsShortcut">
+                                <property name="accelerator">&lt;Primary&gt;w</property>
+                                <property name="title" translatable="yes">Close a window</property>
+                                <property name="visible">True</property>
+                            </object>
+                        </child>
+                    </object>
+                </child>
+                <child>
+                    <object class="GtkShortcutsGroup">
+                        <property name="name" translatable="yes">Search</property>
+                        <property name="visible">True</property>
+                        <child>
+                            <object class="GtkShortcutsShortcut">
+                                <property name="accelerator">&lt;Primary&gt;f</property>
+                                <property name="title" translatable="yes">Find</property>
+                                <property name="visible">True</property>
+                            </object>
+                        </child>
+                    </object>
+                </child>
+            </object>
+        </child>
+    </object>
+</interface>
diff --git a/data/menus.ui b/data/menus.ui
index bc9b17f..1655df4 100644
--- a/data/menus.ui
+++ b/data/menus.ui
@@ -14,6 +14,10 @@
                 <attribute name="action">app.help</attribute>
             </item>
             <item>
+                <attribute name="label" translatable="yes">Keyboard Shortcuts</attribute>
+                <attribute name="action">win.show-help-overlay</attribute>
+            </item>
+            <item>
                 <attribute name="label" translatable="yes">_About</attribute>
                 <attribute name="action">app.about</attribute>
             </item>
diff --git a/data/org.gnome.Logs.gresource.xml b/data/org.gnome.Logs.gresource.xml
index 46d38a3..f91a628 100644
--- a/data/org.gnome.Logs.gresource.xml
+++ b/data/org.gnome.Logs.gresource.xml
@@ -10,6 +10,7 @@
     <file preprocess='xml-stripblanks'>gl-window.ui</file>
   </gresource>
   <gresource prefix='/org/gnome/Logs/gtk'>
+    <file preprocess='xml-stripblanks'>help-overlay.ui</file>
     <file preprocess='xml-stripblanks'>menus.ui</file>
   </gresource>
 </gresources>


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