[gnome-control-center/wip/networking2: 29/36] network: Fix sizing issues of the profile list



commit 6c43fb9a89a9a6ce35584cf89d1439a109764e27
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jan 6 20:53:52 2013 -0500

    network: Fix sizing issues of the profile list
    
    Make it so that the list starts to scroll when there's more
    than 4 profiles.

 panels/network/net-device-ethernet.c |   13 +++++++++++++
 panels/network/network-ethernet.ui   |   20 +++++++++++++++++---
 2 files changed, 30 insertions(+), 3 deletions(-)
---
diff --git a/panels/network/net-device-ethernet.c b/panels/network/net-device-ethernet.c
index 01100b8..80781b1 100644
--- a/panels/network/net-device-ethernet.c
+++ b/panels/network/net-device-ethernet.c
@@ -351,6 +351,19 @@ populate_ui (NetDeviceEthernet *device)
         connections = valid_connections_for_device (settings, NET_DEVICE (device));
 
         n_connections = g_slist_length (connections);
+
+        if (n_connections > 4) {
+                gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (device->scrolled_window),
+                                                GTK_POLICY_NEVER,
+                                                GTK_POLICY_AUTOMATIC);
+                gtk_widget_set_vexpand (device->scrolled_window, TRUE);
+        } else {
+                gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (device->scrolled_window),
+                                                GTK_POLICY_NEVER,
+                                                GTK_POLICY_NEVER);
+                gtk_widget_set_vexpand (device->scrolled_window, FALSE);
+        }
+
         if (n_connections > 1) {
                 gtk_widget_hide (device->details);
                 gtk_widget_hide (device->details_button);
diff --git a/panels/network/network-ethernet.ui b/panels/network/network-ethernet.ui
index a347ef9..fcb4108 100644
--- a/panels/network/network-ethernet.ui
+++ b/panels/network/network-ethernet.ui
@@ -111,11 +111,10 @@
               <object class="GtkScrolledWindow" id="list">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
+                <property name="margin_top">20</property>
                 <property name="hexpand">True</property>
-                <property name="vexpand">True</property>
                 <property name="hscrollbar_policy">never</property>
                 <property name="shadow_type">in</property>
-                <property name="margin_top">20</property>
                 <child>
                   <placeholder/>
                 </child>
@@ -131,11 +130,26 @@
               <object class="GtkGrid" id="details">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="margin_top">20</property>
                 <property name="hexpand">True</property>
                 <property name="vexpand">True</property>
                 <property name="row_spacing">10</property>
                 <property name="column_spacing">10</property>
-                <property name="margin_top">20</property>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
                 <child>
                   <placeholder/>
                 </child>



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