[gnome-tetravex] Add Keyboard Shortcuts overlay



commit 8f8d46666721d913b616ddec2e88d339bfc08ce3
Author: Jeremy Bicha <jbicha ubuntu com>
Date:   Sun Dec 9 10:44:07 2018 -0500

    Add Keyboard Shortcuts overlay

 src/app-menu.ui                  |  4 ++
 src/gnome-tetravex.gresource.xml |  4 ++
 src/help-overlay.ui              | 80 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 88 insertions(+)
---
diff --git a/src/app-menu.ui b/src/app-menu.ui
index 6b50fc7..9b01856 100644
--- a/src/app-menu.ui
+++ b/src/app-menu.ui
@@ -44,6 +44,10 @@
       </submenu>
     </section>
     <section>
+      <item>
+        <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
+        <attribute name="action">win.show-help-overlay</attribute>
+      </item>
       <item>
         <attribute name="label" translatable="yes">_Help</attribute>
         <attribute name="action">app.help</attribute>
diff --git a/src/gnome-tetravex.gresource.xml b/src/gnome-tetravex.gresource.xml
index caca0a0..7f1d34d 100644
--- a/src/gnome-tetravex.gresource.xml
+++ b/src/gnome-tetravex.gresource.xml
@@ -4,4 +4,8 @@
     <file preprocess="xml-stripblanks">gnome-tetravex.ui</file>
     <file preprocess="xml-stripblanks">app-menu.ui</file>
   </gresource>
+  <gresource prefix="/org/gnome/tetravex/gtk">
+    <file preprocess="xml-stripblanks">help-overlay.ui</file>
+  </gresource>
 </gresources>
+<?xml version="1.0" encoding="UTF-8"?>
diff --git a/src/help-overlay.ui b/src/help-overlay.ui
new file mode 100644
index 0000000..a7186fe
--- /dev/null
+++ b/src/help-overlay.ui
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.17 -->
+  <object class="GtkShortcutsWindow" id="help_overlay">
+    <property name="modal">1</property>
+    <child>
+      <object class="GtkShortcutsSection">
+        <property name="visible">1</property>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Ctrl&gt;N</property>
+                <property name="title" translatable="yes" context="shortcut window">Start a new 
game</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">Pause</property>
+                <property name="title" translatable="yes" context="shortcut window">Pause the game</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Ctrl&gt;Up</property>
+                <property name="title" translatable="yes" context="shortcut window">Move all the pieces in 
the left box up by one</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Ctrl&gt;Down</property>
+                <property name="title" translatable="yes" context="shortcut window">Move all the pieces in 
the left box down by one</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Ctrl&gt;Left</property>
+                <property name="title" translatable="yes" context="shortcut window">Move all the pieces in 
the left box left by one</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Ctrl&gt;Right</property>
+                <property name="title" translatable="yes" context="shortcut window">Move all the pieces in 
the left box right by one</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">F1</property>
+                <property name="title" translatable="yes" context="shortcut window">Show Help</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Primary&gt;question &lt;Primary&gt;F1</property>
+                <property name="title" translatable="yes" context="shortcut window">Show Keyboard 
Shortcuts</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Ctrl&gt;Q</property>
+                <property name="title" translatable="yes" context="shortcut window">Quit</property>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>


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