[gnome-games/wip/exalm/ds: 21/21] Quick switch



commit ee9d7daaf149f136624f00a701139e0bf41509f8
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Tue Jan 8 02:47:19 2019 +0500

    Quick switch

 .../icons/screen-layout-quick-switch-symbolic.svg  | 82 ++++++++++++++++++++++
 .../icons/screen-layout-top-bottom-symbolic.svg    | 12 ++--
 plugins/nintendo-ds/data/nintendo-ds.gresource.xml |  1 +
 ...org.gnome.Games.plugins.nintendo-ds.gschema.xml |  3 +-
 .../data/ui/nintendo-ds-layout-switcher.ui         | 20 ++++++
 .../src/nintendo-ds-layout-switcher.vala           |  8 +++
 6 files changed, 119 insertions(+), 7 deletions(-)
---
diff --git a/plugins/nintendo-ds/data/icons/screen-layout-quick-switch-symbolic.svg 
b/plugins/nintendo-ds/data/icons/screen-layout-quick-switch-symbolic.svg
new file mode 100644
index 00000000..948de2cd
--- /dev/null
+++ b/plugins/nintendo-ds/data/icons/screen-layout-quick-switch-symbolic.svg
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="16"
+   height="16"
+   version="1.1"
+   id="svg8"
+   sodipodi:docname="screen-layout-quick-switch-symbolic.svg"
+   inkscape:version="0.92.2 2405546, 2018-03-11">
+  <metadata
+     id="metadata14">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs12" />
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1920"
+     inkscape:window-height="1016"
+     id="namedview10"
+     showgrid="true"
+     inkscape:zoom="22.627417"
+     inkscape:cx="4.8932382"
+     inkscape:cy="10.034779"
+     inkscape:window-x="0"
+     inkscape:window-y="27"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg8">
+    <inkscape:grid
+       type="xygrid"
+       id="grid4526" />
+  </sodipodi:namedview>
+  <path
+     
style="opacity:0.5;fill:#474747;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="m 8,1 c 0.942809,0 1.999979,1.057191 2,2 V 5 H 8 V 3 H 3 v 5 h 2 v 2 H 3 C 2.057191,10 
1.000021,8.942809 1,8 V 3 C 0.999979,2.057191 2.057191,1 3,1 Z"
+     id="path872"
+     inkscape:connector-curvature="0" />
+  <path
+     sodipodi:nodetypes="sccssccssccccc"
+     inkscape:connector-curvature="0"
+     id="path817"
+     d="m 13,6 c 0.942809,0 1.999979,1.057191 2,2 v 5 c 2.1e-5,0.942809 -1.057191,2 -2,2 H 8 C 7.057191,15 
6.000021,13.942809 6,13 V 8 C 5.999979,7.057191 7.057191,6 8,6 Z m 0,2 H 8 v 5 h 5 z"
+     
style="fill:#474747;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
 />
+  <path
+     sodipodi:nodetypes="ccsccccc"
+     inkscape:connector-curvature="0"
+     id="path895"
+     d="M 24.277344,2 V 5 H 26 c 0.942809,0 2.000021,1.057191 2,2 v 2 h 3 V 2 Z"
+     
style="opacity:0.5;fill:#474747;fill-opacity:1;stroke:none;stroke-width:1.43412018;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
 />
+  <path
+     id="path897"
+     d="m 25,1 c -0.942809,0 -1.999979,1.057191 -2,2 v 2 h 2 V 3 h 5 v 5 h -2 v 2 h 2 c 0.942809,0 
1.999979,-1.057191 2,-2 V 3 c 2.1e-5,-0.942809 -1.057191,-2 -2,-2 z"
+     
style="fill:#474747;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     inkscape:connector-curvature="0" />
+  <path
+     
style="fill:#474747;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+     d="m 20,6 c -0.942809,0 -1.999979,1.057191 -2,2 v 5 c -2.1e-5,0.942809 1.057191,2 2,2 h 5 c 0.942809,0 
1.999979,-1.057191 2,-2 V 8 c 2.1e-5,-0.942809 -1.057191,-2 -2,-2 z m 0,2 h 5 v 5 h -5 z"
+     id="path899"
+     inkscape:connector-curvature="0"
+     sodipodi:nodetypes="sccssccssccccc" />
+</svg>
diff --git a/plugins/nintendo-ds/data/icons/screen-layout-top-bottom-symbolic.svg 
b/plugins/nintendo-ds/data/icons/screen-layout-top-bottom-symbolic.svg
index 5f633d76..03ac6d38 100644
--- a/plugins/nintendo-ds/data/icons/screen-layout-top-bottom-symbolic.svg
+++ b/plugins/nintendo-ds/data/icons/screen-layout-top-bottom-symbolic.svg
@@ -11,7 +11,7 @@
    height="16"
    version="1.1"
    id="svg8"
-   sodipodi:docname="ds-touchscreen-bottom.svg"
+   sodipodi:docname="screen-layout-top-bottom-symbolic.svg"
    inkscape:version="0.92.2 2405546, 2018-03-11">
   <metadata
      id="metadata14">
@@ -36,13 +36,13 @@
      guidetolerance="10"
      inkscape:pageopacity="0"
      inkscape:pageshadow="2"
-     inkscape:window-width="2560"
-     inkscape:window-height="1376"
+     inkscape:window-width="1920"
+     inkscape:window-height="1016"
      id="namedview10"
      showgrid="true"
-     inkscape:zoom="64"
-     inkscape:cx="3.6767386"
-     inkscape:cy="8.1664307"
+     inkscape:zoom="22.627417"
+     inkscape:cx="10.188329"
+     inkscape:cy="10.034285"
      inkscape:window-x="0"
      inkscape:window-y="27"
      inkscape:window-maximized="1"
diff --git a/plugins/nintendo-ds/data/nintendo-ds.gresource.xml 
b/plugins/nintendo-ds/data/nintendo-ds.gresource.xml
index 481e1a75..8496b28c 100644
--- a/plugins/nintendo-ds/data/nintendo-ds.gresource.xml
+++ b/plugins/nintendo-ds/data/nintendo-ds.gresource.xml
@@ -2,6 +2,7 @@
   <gresource prefix="/org/gnome/Games/plugins/nintendo-ds">
     <file>ui/nintendo-ds-layout-switcher.ui</file>
     <file>icons/screen-layout-left-right-symbolic.svg</file>
+    <file>icons/screen-layout-quick-switch-symbolic.svg</file>
     <file>icons/screen-layout-right-left-symbolic.svg</file>
     <file>icons/screen-layout-top-bottom-symbolic.svg</file>
   </gresource>
diff --git a/plugins/nintendo-ds/data/org.gnome.Games.plugins.nintendo-ds.gschema.xml 
b/plugins/nintendo-ds/data/org.gnome.Games.plugins.nintendo-ds.gschema.xml
index 0d48cc28..8e170f63 100644
--- a/plugins/nintendo-ds/data/org.gnome.Games.plugins.nintendo-ds.gschema.xml
+++ b/plugins/nintendo-ds/data/org.gnome.Games.plugins.nintendo-ds.gschema.xml
@@ -3,12 +3,13 @@
     <value nick="top/bottom" value="0"/>
     <value nick="left/right" value="1"/>
     <value nick="right/left" value="2"/>
+    <value nick="quick switch" value="3"/>
   </enum>
   <schema path="/org/gnome/Games/plugins/nintendo-ds/" id="org.gnome.Games.plugins.nintendo-ds" 
gettext-domain="gnome-games">
     <key name='screen-layout' enum='org.gnome.Games.plugins.nintendo-ds.screen-layouts'>
       <default>'top/bottom'</default>
       <summary>Screen layout</summary>
-      <description>Screen layout for Nintendo DS games. Allowed values are: “top/bottom”, “left/right” and 
"right/left".</description>
+      <description>Screen layout for Nintendo DS games. Allowed values are: “top/bottom”, “left/right”, 
“right/left” and “quick switch”.</description>
     </key>
   </schema>
 </schemalist>
diff --git a/plugins/nintendo-ds/data/ui/nintendo-ds-layout-switcher.ui 
b/plugins/nintendo-ds/data/ui/nintendo-ds-layout-switcher.ui
index a7ea2538..a5a0fa2a 100644
--- a/plugins/nintendo-ds/data/ui/nintendo-ds-layout-switcher.ui
+++ b/plugins/nintendo-ds/data/ui/nintendo-ds-layout-switcher.ui
@@ -66,5 +66,25 @@
         </child>
       </object>
     </child>
+    <child>
+      <object class="GtkRadioButton" id="quick_switch_button">
+        <property name="visible">True</property>
+        <property name="can-focus">False</property>
+        <property name="draw-indicator">False</property>
+        <property name="group">left_right_button</property>
+        <signal name="toggled" handler="on_layout_changed"/>
+        <child internal-child="accessible">
+          <object class="AtkObject">
+            <property name="accessible-name" translatable="yes">Quick Switch</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkImage">
+            <property name="visible">True</property>
+            <property name="icon-name">screen-layout-quick-switch-symbolic</property>
+          </object>
+        </child>
+      </object>
+    </child>
   </template>
 </interface>
diff --git a/plugins/nintendo-ds/src/nintendo-ds-layout-switcher.vala 
b/plugins/nintendo-ds/src/nintendo-ds-layout-switcher.vala
index 9ba4f74c..9303a43e 100644
--- a/plugins/nintendo-ds/src/nintendo-ds-layout-switcher.vala
+++ b/plugins/nintendo-ds/src/nintendo-ds-layout-switcher.vala
@@ -8,6 +8,8 @@ private class Games.NintendoDsLayoutSwitcher : Gtk.Box {
        private Gtk.RadioButton top_bottom_button;
        [GtkChild]
        private Gtk.RadioButton right_left_button;
+       [GtkChild]
+       private Gtk.RadioButton quick_switch_button;
 
        private Settings settings;
 
@@ -42,6 +44,9 @@ private class Games.NintendoDsLayoutSwitcher : Gtk.Box {
 
                case "right/left":
                        return right_left_button;
+
+               case "quick switch":
+                       return quick_switch_button;
                }
 
                return null;
@@ -57,6 +62,9 @@ private class Games.NintendoDsLayoutSwitcher : Gtk.Box {
                if (right_left_button.active)
                        return "right/left";
 
+               if (quick_switch_button.active)
+                       return "quick switch";
+
                return "";
        }
 


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