[gnome-games] shortcuts-window: List Nintendo DS shortcuts



commit 9587692a2bb73819740261fc9151bddbce074782
Author: Stoian Dan <danmihaistoian gmail com>
Date:   Fri May 3 18:07:12 2019 +0300

    shortcuts-window: List Nintendo DS shortcuts
    
    Fixes #173

 data/ui/shortcuts-window.ui  | 73 ++++++++++++++++++++++++++++++++++++++++++++
 src/ui/shortcuts-window.vala |  7 ++++-
 2 files changed, 79 insertions(+), 1 deletion(-)
---
diff --git a/data/ui/shortcuts-window.ui b/data/ui/shortcuts-window.ui
index 25445119..cc86abdd 100644
--- a/data/ui/shortcuts-window.ui
+++ b/data/ui/shortcuts-window.ui
@@ -129,6 +129,78 @@
         </child>
       </object>
     </child>
+    <child>
+      <object class="GtkShortcutsSection">
+        <property name="max-height">12</property>
+        <property name="section-name">nintendo_ds</property>
+        <property name="title" translatable="yes">Nintendo DS</property>
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="title" translatable="yes">Screen Layout</property>
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">True</property>
+                <property name="title" translatable="yes" context="shortcut window">Vertical</property>
+                <property name="accelerator">&lt;alt&gt;1</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">True</property>
+                <property name="title" translatable="yes" context="shortcut window">Side by side</property>
+                <property name="subtitle" translatable="yes" context="shortcut window">Bottom to the 
right</property>
+                <property name="accelerator">&lt;alt&gt;2</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">True</property>
+                <property name="title" translatable="yes" context="shortcut window">Side by side</property>
+                <property name="subtitle" translatable="yes" context="shortcut window">Bottom to the 
left</property>
+                <property name="accelerator">&lt;alt&gt;3</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">True</property>
+                <property name="title" translatable="yes" context="shortcut window">Single screen</property>
+                <property name="accelerator">&lt;alt&gt;4</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="title" translatable="yes">Screen Switching</property>
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">True</property>
+                <property name="title" translatable="yes" context="shortcut window">Show top 
screen</property>
+                <property name="accelerator">Page_Up</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">True</property>
+                <property name="title" translatable="yes" context="shortcut window">Show bottom 
screen</property>
+                <property name="accelerator">Page_Down</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut" id="nintendo_ds_shortcut_right_stick">
+                <property name="visible">True</property>
+                <property name="shortcut-type">gesture</property>
+                <property name="title" translatable="yes" context="shortcut window">Toggle screen</property>
+                <property name="subtitle" translatable="yes" context="shortcut window">Press right analog 
stick</property>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
     <child>
       <object class="GtkShortcutsSection">
         <property name="max-height">12</property>
@@ -152,3 +224,4 @@
     </child>
   </template>
 </interface>
+
diff --git a/src/ui/shortcuts-window.vala b/src/ui/shortcuts-window.vala
index 7a665bab..b3d37c66 100644
--- a/src/ui/shortcuts-window.vala
+++ b/src/ui/shortcuts-window.vala
@@ -20,11 +20,15 @@ private class Games.ShortcutsWindow : Gtk.ShortcutsWindow {
        private Gtk.ShortcutsShortcut ingame_shortcut_south;
        [GtkChild]
        private Gtk.ShortcutsShortcut ingame_shortcut_east;
+       [GtkChild]
+       private Gtk.ShortcutsShortcut nintendo_ds_shortcut_right_stick;
 
        construct {
                update_direction ();
 
-               collection_shortcut_left_stick.icon = icon_for_uri 
("resource:///org/gnome/Games/gesture/stick-symbolic.svg");
+               var stick_icon = icon_for_uri ("resource:///org/gnome/Games/gesture/stick-symbolic.svg");
+
+               collection_shortcut_left_stick.icon = stick_icon;
                collection_shortcut_dpad.icon = icon_for_uri 
("resource:///org/gnome/Games/gesture/dpad-symbolic.svg");
                collection_shortcut_shoulders_front.icon = icon_for_uri 
("resource:///org/gnome/Games/gesture/shoulders-front-symbolic.svg");
                collection_shortcut_start.icon = icon_for_uri 
("resource:///org/gnome/Games/gesture/button-start-symbolic.svg");
@@ -32,6 +36,7 @@ private class Games.ShortcutsWindow : Gtk.ShortcutsWindow {
                ingame_shortcut_home.icon = icon_for_uri 
("resource:///org/gnome/Games/gesture/button-home-symbolic.svg");
                ingame_shortcut_south.icon = icon_for_uri 
("resource:///org/gnome/Games/gesture/button-south-symbolic.svg");
                ingame_shortcut_east.icon = icon_for_uri 
("resource:///org/gnome/Games/gesture/button-east-symbolic.svg");
+               nintendo_ds_shortcut_right_stick.icon = stick_icon;
        }
 
        static GLib.Icon icon_for_uri (string uri) {


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