[gnome-control-center/wip/rishi/new-goa-panel: 3/5] online-accounts: Align the panel widgets in the middle



commit 219d628fb09fd2ca6236db7cd2c3acc7037dfaf8
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Nov 10 19:16:27 2016 -0200

    online-accounts: Align the panel widgets in the middle
    
    The current implementation of the Online Accounts panel allows
    2 states: either the widgets of the panel fill the whole horizontal
    space, or they shrink and fill only the absolutely minimum. The
    ideal solution, however, is to make them grow with the panel.
    
    Fix that by turn the main box into a GtkGrid, and adding stub widgets
    that expand horizontally and pull the main widgets to the middle,
    allowing them to cover at most 1/3 of the screen.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774222

 panels/online-accounts/online-accounts.ui |   54 +++++++++++++++++++++++++++-
 1 files changed, 52 insertions(+), 2 deletions(-)
---
diff --git a/panels/online-accounts/online-accounts.ui b/panels/online-accounts/online-accounts.ui
index 31ca3e1..98cf9e8 100644
--- a/panels/online-accounts/online-accounts.ui
+++ b/panels/online-accounts/online-accounts.ui
@@ -70,10 +70,11 @@
             <property name="hscrollbar_policy">never</property>
             <property name="min_content_height">350</property>
             <child>
-              <object class="GtkBox">
+              <object class="GtkGrid">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="spacing">18</property>
+                <property name="row-spacing">18</property>
+                <property name="column-spacing">18</property>
                 <property name="orientation">vertical</property>
                 <property name="margin_start">32</property>
                 <property name="margin_end">32</property>
@@ -81,6 +82,35 @@
                 <property name="margin_bottom">18</property>
                 <property name="hexpand">True</property>
                 <property name="width-request">300</property>
+
+                <!--
+                  Stub boxes to pull the widgets to the middle, and yet allow them to
+                  grow and cover a third of the available space
+                -->
+                <child>
+                  <object class="GtkBox">
+                    <property name="visible">True</property>
+                    <property name="hexpand">True</property>
+                  </object>
+                  <packing>
+                    <property name="top-attach">0</property>
+                    <property name="left-attach">0</property>
+                    <property name="height">5</property>
+                  </packing>
+                </child>
+
+                <child>
+                  <object class="GtkBox">
+                    <property name="visible">True</property>
+                    <property name="hexpand">True</property>
+                  </object>
+                  <packing>
+                    <property name="top-attach">0</property>
+                    <property name="left-attach">2</property>
+                    <property name="height">5</property>
+                  </packing>
+                </child>
+
                 <child>
                   <object class="GtkLabel">
                     <property name="visible">True</property>
@@ -90,6 +120,10 @@
                       <attribute name="scale" value="1.66" />
                     </attributes>
                   </object>
+                  <packing>
+                    <property name="top-attach">0</property>
+                    <property name="left-attach">1</property>
+                  </packing>
                 </child>
                 <child>
                   <object class="GtkLabel" id="offline_label">
@@ -98,6 +132,10 @@
                     <property name="wrap">True</property>
                     <property name="label" translatable="yes">No internet connection — connect to setup new 
online accounts</property>
                   </object>
+                  <packing>
+                    <property name="top-attach">1</property>
+                    <property name="left-attach">1</property>
+                  </packing>
                 </child>
                 <child>
                   <object class="GtkFrame" id="accounts_frame">
@@ -112,6 +150,10 @@
                       </object>
                     </child>
                   </object>
+                  <packing>
+                    <property name="top-attach">2</property>
+                    <property name="left-attach">1</property>
+                  </packing>
                 </child>
                 <child>
                   <object class="GtkLabel">
@@ -124,6 +166,10 @@
                       <attribute name="weight" value="bold" />
                     </attributes>
                   </object>
+                  <packing>
+                    <property name="top-attach">3</property>
+                    <property name="left-attach">1</property>
+                  </packing>
                 </child>
                 <child>
                   <object class="GtkFrame">
@@ -153,6 +199,10 @@
                       </object>
                     </child>
                   </object>
+                  <packing>
+                    <property name="top-attach">4</property>
+                    <property name="left-attach">1</property>
+                  </packing>
                 </child>
               </object>
             </child>


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