[gnome-games/wip/exalm/preferences: 12/13] preferences-subpage-gamepad: Revert to GtkHeaderBar



commit 4019d7aff8eb01d76c53790ef79f9e1f282c15ab
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Wed Jun 3 16:50:36 2020 +0500

    preferences-subpage-gamepad: Revert to GtkHeaderBar
    
    Avoid double back buttons, see https://gitlab.gnome.org/GNOME/libhandy/-/issues/195

 data/ui/preferences-subpage-gamepad.ui  | 66 ++++++++++++++++++++-------------
 src/ui/preferences-subpage-gamepad.vala |  4 +-
 2 files changed, 42 insertions(+), 28 deletions(-)
---
diff --git a/data/ui/preferences-subpage-gamepad.ui b/data/ui/preferences-subpage-gamepad.ui
index 986d1d54..53ff0ef1 100644
--- a/data/ui/preferences-subpage-gamepad.ui
+++ b/data/ui/preferences-subpage-gamepad.ui
@@ -12,32 +12,40 @@
             <property name="visible">True</property>
             <property name="orientation">vertical</property>
             <child>
-              <object class="HdyHeaderBar" id="tester_header_bar">
+              <object class="HdyWindowHandle">
                 <property name="visible">True</property>
-                <property name="show-close-button">True</property>
                 <child>
-                  <object class="GtkButton">
+                  <object class="GtkHeaderBar" id="tester_header_bar">
                     <property name="visible">True</property>
-                    <signal name="clicked" handler="on_back_clicked"/>
+                    <property name="show-close-button">True</property>
                     <style>
-                      <class name="image-button"/>
+                      <class name="titlebar"/>
                     </style>
-                    <child internal-child="accessible">
-                      <object class="AtkObject" id="a11y-back">
-                        <property name="accessible-name" translatable="yes">Back</property>
-                      </object>
-                    </child>
                     <child>
-                      <object class="GtkImage">
+                      <object class="GtkButton">
                         <property name="visible">True</property>
-                        <property name="icon-name">go-previous-symbolic</property>
-                        <property name="icon-size">1</property>
+                        <signal name="clicked" handler="on_back_clicked"/>
+                        <style>
+                          <class name="image-button"/>
+                        </style>
+                        <child internal-child="accessible">
+                          <object class="AtkObject" id="a11y-back">
+                            <property name="accessible-name" translatable="yes">Back</property>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkImage">
+                            <property name="visible">True</property>
+                            <property name="icon-name">go-previous-symbolic</property>
+                            <property name="icon-size">1</property>
+                          </object>
+                        </child>
                       </object>
+                      <packing>
+                        <property name="pack-type">start</property>
+                      </packing>
                     </child>
                   </object>
-                  <packing>
-                    <property name="pack-type">start</property>
-                  </packing>
                 </child>
               </object>
             </child>
@@ -79,20 +87,26 @@
             <property name="visible">True</property>
             <property name="orientation">vertical</property>
             <child>
-              <object class="HdyHeaderBar" id="mapper_header_bar">
+              <object class="HdyWindowHandle">
                 <property name="visible">True</property>
-                <style>
-                  <class name="selection-mode"/>
-                </style>
                 <child>
-                  <object class="GtkButton">
+                  <object class="GtkHeaderBar" id="mapper_header_bar">
                     <property name="visible">True</property>
-                    <property name="label" translatable="yes">Cancel</property>
-                    <signal name="clicked" handler="on_cancel_clicked"/>
+                    <style>
+                      <class name="titlebar"/>
+                      <class name="selection-mode"/>
+                    </style>
+                    <child>
+                      <object class="GtkButton">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">Cancel</property>
+                        <signal name="clicked" handler="on_cancel_clicked"/>
+                      </object>
+                      <packing>
+                        <property name="pack-type">end</property>
+                      </packing>
+                    </child>
                   </object>
-                  <packing>
-                    <property name="pack-type">end</property>
-                  </packing>
                 </child>
               </object>
             </child>
diff --git a/src/ui/preferences-subpage-gamepad.vala b/src/ui/preferences-subpage-gamepad.vala
index b6df01f4..36b1019c 100644
--- a/src/ui/preferences-subpage-gamepad.vala
+++ b/src/ui/preferences-subpage-gamepad.vala
@@ -73,9 +73,9 @@ private class Games.PreferencesSubpageGamepad : Gtk.Bin, PreferencesSubpage {
        [GtkChild]
        private Gtk.Box mapper_box;
        [GtkChild]
-       private Hdy.HeaderBar tester_header_bar;
+       private Gtk.HeaderBar tester_header_bar;
        [GtkChild]
-       private Hdy.HeaderBar mapper_header_bar;
+       private Gtk.HeaderBar mapper_header_bar;
        [GtkChild]
        private Gtk.Button reset_button;
 


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