[gnome-games/wip/exalm/libhandy2: 18/22] ui: Use HdyColumn for preferences pages



commit 37509d662ac2d854bbc404422aadda978392d104
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Wed Sep 12 13:51:17 2018 +0500

    ui: Use HdyColumn for preferences pages

 data/ui/preferences-page-controllers.ui | 84 ++++++++++++++++++---------------
 data/ui/preferences-page-plugins.ui     | 26 ++++++----
 data/ui/preferences-page-video.ui       | 46 ++++++++++--------
 src/main.vala                           |  2 +
 4 files changed, 92 insertions(+), 66 deletions(-)
---
diff --git a/data/ui/preferences-page-controllers.ui b/data/ui/preferences-page-controllers.ui
index c5d18374..a0d8c3ec 100644
--- a/data/ui/preferences-page-controllers.ui
+++ b/data/ui/preferences-page-controllers.ui
@@ -10,53 +10,61 @@
           <object class="GtkViewport">
             <property name="visible">True</property>
             <child>
-              <object class="GtkBox">
+              <object class="HdyColumn">
                 <property name="visible">True</property>
-                <property name="orientation">vertical</property>
-                <property name="margin">12</property>
-                <property name="spacing">12</property>
+                <property name="expand">True</property>
+                <property name="maximum_width">600</property>
+                <property name="linear-growth-width">300</property>
                 <child>
-                  <object class="GtkLabel" id="gamepads_label">
+                  <object class="GtkBox">
                     <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label" translatable="yes">Gamepads</property>
-                    <attributes>
-                      <attribute name="weight" value="bold"/>
-                    </attributes>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkFrame" id="gamepads_frame">
-                    <property name="visible">True</property>
-                    <property name="shadow_type">in</property>
+                    <property name="orientation">vertical</property>
+                    <property name="margin">12</property>
+                    <property name="spacing">12</property>
                     <child>
-                      <object class="GtkListBox" id="gamepads_list_box">
+                      <object class="GtkLabel" id="gamepads_label">
                         <property name="visible">True</property>
-                        <property name="selection_mode">none</property>
-                        <signal name="row-activated" handler="gamepads_list_box_row_activated"/>
+                        <property name="halign">start</property>
+                        <property name="label" translatable="yes">Gamepads</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkFrame" id="gamepads_frame">
+                        <property name="visible">True</property>
+                        <property name="shadow_type">in</property>
+                        <child>
+                          <object class="GtkListBox" id="gamepads_list_box">
+                            <property name="visible">True</property>
+                            <property name="selection_mode">none</property>
+                            <signal name="row-activated" handler="gamepads_list_box_row_activated"/>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkLabel">
+                        <property name="visible">True</property>
+                        <property name="halign">start</property>
+                        <property name="label" translatable="yes">Keyboard</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
                       </object>
                     </child>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkLabel">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label" translatable="yes">Keyboard</property>
-                    <attributes>
-                      <attribute name="weight" value="bold"/>
-                    </attributes>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkFrame">
-                    <property name="visible">True</property>
-                    <property name="shadow_type">in</property>
                     <child>
-                      <object class="GtkListBox" id="keyboard_list_box">
+                      <object class="GtkFrame">
                         <property name="visible">True</property>
-                        <property name="selection_mode">none</property>
-                        <signal name="row-activated" handler="keyboard_list_box_row_activated"/>
+                        <property name="shadow_type">in</property>
+                        <child>
+                          <object class="GtkListBox" id="keyboard_list_box">
+                            <property name="visible">True</property>
+                            <property name="selection_mode">none</property>
+                            <signal name="row-activated" handler="keyboard_list_box_row_activated"/>
+                          </object>
+                        </child>
                       </object>
                     </child>
                   </object>
diff --git a/data/ui/preferences-page-plugins.ui b/data/ui/preferences-page-plugins.ui
index bda34acc..f3c1ea5e 100644
--- a/data/ui/preferences-page-plugins.ui
+++ b/data/ui/preferences-page-plugins.ui
@@ -11,19 +11,27 @@
           <object class="GtkViewport">
             <property name="visible">true</property>
             <child>
-              <object class="GtkBox">
+              <object class="HdyColumn">
                 <property name="visible">True</property>
-                <property name="orientation">vertical</property>
-                <property name="margin">12</property>
-                <property name="spacing">12</property>
+                <property name="expand">True</property>
+                <property name="maximum_width">600</property>
+                <property name="linear-growth-width">300</property>
                 <child>
-                  <object class="GtkFrame">
-                    <property name="visible">true</property>
-                    <property name="shadow-type">in</property>
+                  <object class="GtkBox">
+                    <property name="visible">True</property>
+                    <property name="orientation">vertical</property>
+                    <property name="margin">12</property>
+                    <property name="spacing">12</property>
                     <child>
-                      <object class="GtkListBox" id="list_box">
-                        <property name="selection-mode">none</property>
+                      <object class="GtkFrame">
                         <property name="visible">true</property>
+                        <property name="shadow-type">in</property>
+                        <child>
+                          <object class="GtkListBox" id="list_box">
+                            <property name="selection-mode">none</property>
+                            <property name="visible">true</property>
+                          </object>
+                        </child>
                       </object>
                     </child>
                   </object>
diff --git a/data/ui/preferences-page-video.ui b/data/ui/preferences-page-video.ui
index e700f5be..be65929d 100644
--- a/data/ui/preferences-page-video.ui
+++ b/data/ui/preferences-page-video.ui
@@ -10,30 +10,38 @@
           <object class="GtkViewport">
             <property name="visible">True</property>
             <child>
-              <object class="GtkBox">
+              <object class="HdyColumn">
                 <property name="visible">True</property>
-                <property name="orientation">vertical</property>
-                <property name="margin">12</property>
-                <property name="spacing">12</property>
+                <property name="expand">True</property>
+                <property name="maximum_width">600</property>
+                <property name="linear-growth-width">300</property>
                 <child>
-                  <object class="GtkLabel">
+                  <object class="GtkBox">
                     <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label" translatable="yes">Filter</property>
-                    <attributes>
-                      <attribute name="weight" value="bold"/>
-                    </attributes>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkFrame">
-                    <property name="visible">True</property>
-                    <property name="shadow_type">in</property>
+                    <property name="orientation">vertical</property>
+                    <property name="margin">12</property>
+                    <property name="spacing">12</property>
+                    <child>
+                      <object class="GtkLabel">
+                        <property name="visible">True</property>
+                        <property name="halign">start</property>
+                        <property name="label" translatable="yes">Filter</property>
+                        <attributes>
+                          <attribute name="weight" value="bold"/>
+                        </attributes>
+                      </object>
+                    </child>
                     <child>
-                      <object class="GtkListBox" id="filter_list_box">
+                      <object class="GtkFrame">
                         <property name="visible">True</property>
-                        <property name="selection_mode">none</property>
-                        <signal name="row-activated" handler="filter_list_box_row_activated"/>
+                        <property name="shadow_type">in</property>
+                        <child>
+                          <object class="GtkListBox" id="filter_list_box">
+                            <property name="visible">True</property>
+                            <property name="selection_mode">none</property>
+                            <signal name="row-activated" handler="filter_list_box_row_activated"/>
+                          </object>
+                        </child>
                       </object>
                     </child>
                   </object>
diff --git a/src/main.vala b/src/main.vala
index accb61fa..50cea9d0 100644
--- a/src/main.vala
+++ b/src/main.vala
@@ -7,6 +7,8 @@ int main (string[] args) {
 
        Grl.init (ref args);
 
+       typeof (Hdy.Column).ensure ();
+
        var app = new Games.Application ();
        var result = app.run (args);
 


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