[gnome-control-center] online-accounts: make the list boxes in "Other" expand vertically



commit 58669c7d4d87604d1d1ba98a8436c8b1373cb0ca
Author: Marco Barisione <marco barisione collabora co uk>
Date:   Thu Aug 15 13:55:45 2013 +0100

    online-accounts: make the list boxes in "Other" expand vertically
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706148

 .../cc-online-accounts-add-account-dialog.c        |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/panels/online-accounts/cc-online-accounts-add-account-dialog.c 
b/panels/online-accounts/cc-online-accounts-add-account-dialog.c
index df4dd59..d2eeb7e 100644
--- a/panels/online-accounts/cc-online-accounts-add-account-dialog.c
+++ b/panels/online-accounts/cc-online-accounts-add-account-dialog.c
@@ -179,6 +179,7 @@ add_account_dialog_create_provider_ui (GoaPanelAddAccountDialog *add_account,
                                        GtkListBox *list_box)
 {
   GIcon *icon;
+  GList *children;
   GtkWidget *row;
   GtkWidget *row_grid;
   GtkWidget *image;
@@ -205,6 +206,21 @@ add_account_dialog_create_provider_ui (GoaPanelAddAccountDialog *add_account,
       name = goa_provider_get_provider_name (provider, NULL);
     }
 
+  children = gtk_container_get_children (GTK_CONTAINER (list_box));
+  if (children != NULL)
+    {
+      /* FIXME: Ideally we want the list boxes to use as much space as
+       * it's available to try to show all the content, but GtkScrolledView
+       * ignores its child's natural size,
+       * see https://bugzilla.gnome.org/show_bug.cgi?id=660654
+       * For now we just make list boxes with multiple children expand as
+       * the result is quite similar. */
+      GtkWidget *sw;
+      sw = gtk_widget_get_parent (GTK_WIDGET (list_box));
+      gtk_widget_set_vexpand (sw, TRUE);
+      g_list_free (children);
+    }
+
   gtk_container_add (GTK_CONTAINER (list_box), row);
 
   image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_DIALOG);


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