[gnome-games/wip/abhinavsingh/gamepad-config: 16/23] ui: Add skip button to GamepadMapper



commit 21e4b36ea934698afac911d22ad5c8253e9f8f5a
Author: theawless <theawless gmail com>
Date:   Sat Jun 3 16:31:49 2017 +0530

    ui: Add skip button to GamepadMapper

 data/ui/gamepad-mapper.ui  |   10 ++++++++++
 src/ui/gamepad-mapper.vala |    9 ++++++++-
 2 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/data/ui/gamepad-mapper.ui b/data/ui/gamepad-mapper.ui
index 0b91ddd..1628876 100644
--- a/data/ui/gamepad-mapper.ui
+++ b/data/ui/gamepad-mapper.ui
@@ -77,5 +77,15 @@
         <property name="pack-type">end</property>
       </packing>
     </child>
+    <child>
+      <object class="GtkButton" id="skip_button">
+        <property name="visible">True</property>
+        <property name="label" translatable="yes">Skip</property>
+        <signal name="clicked" handler="on_skip_clicked"/>
+      </object>
+      <packing>
+        <property name="pack-type">end</property>
+      </packing>
+    </child>
   </object>
 </interface>
diff --git a/src/ui/gamepad-mapper.vala b/src/ui/gamepad-mapper.vala
index b36216e..e4dca61 100644
--- a/src/ui/gamepad-mapper.vala
+++ b/src/ui/gamepad-mapper.vala
@@ -10,7 +10,6 @@ private class Games.GamepadMapper : Gtk.Box {
                FINISH,
        }
 
-       // TODO: Add skip button
        private State? _state;
        private State? state {
                set {
@@ -28,6 +27,7 @@ private class Games.GamepadMapper : Gtk.Box {
                        case State.CONFIGURE:
                                break;
                        case State.FINISH:
+                               skip_button.set_sensitive (false);
                                apply_button.set_sensitive (true);
                                title.label = _("Finished configuration");
                                disconnect_from_gamepad ();
@@ -81,6 +81,8 @@ private class Games.GamepadMapper : Gtk.Box {
        [GtkChild]
        private Gtk.Button apply_button;
        [GtkChild]
+       private Gtk.Button skip_button;
+       [GtkChild]
        private Gtk.Label title;
 
        private Gamepad gamepad;
@@ -104,6 +106,11 @@ private class Games.GamepadMapper : Gtk.Box {
        }
 
        [GtkCallback]
+       private void on_skip_clicked () {
+               next_input ();
+       }
+
+       [GtkCallback]
        private void on_back_clicked () {
                back ();
        }


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