diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-import-dialog.ui | 3 | ||||
-rw-r--r-- | src/empathy-import-widget.c | 10 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/empathy-import-dialog.ui b/src/empathy-import-dialog.ui index ce7a56a74..2cc9207ba 100644 --- a/src/empathy-import-dialog.ui +++ b/src/empathy-import-dialog.ui @@ -6,7 +6,7 @@ <property name="visible">True</property> <property name="spacing">2</property> <child> - <object class="GtkScrolledWindow" id="scrolledwindow17"> + <object class="GtkScrolledWindow" id="scrolledwindow"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hscrollbar_policy">never</property> @@ -14,7 +14,6 @@ <property name="shadow_type">in</property> <child> <object class="GtkTreeView" id="treeview"> - <property name="height_request">200</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="enable_search">False</property> diff --git a/src/empathy-import-widget.c b/src/empathy-import-widget.c index 40956f9ee..6a2d24a81 100644 --- a/src/empathy-import-widget.c +++ b/src/empathy-import-widget.c @@ -62,6 +62,7 @@ enum { typedef struct { GtkWidget *vbox; GtkWidget *treeview; + GtkWidget *scrolledwindow; GList *accounts; EmpathyImportApplication app_id; @@ -91,6 +92,8 @@ import_widget_account_id_in_list (GList *accounts, return FALSE; } +#define MAX_TREEVIEW_HEIGHT 300 + static void import_widget_add_accounts_to_model (EmpathyImportWidget *self) { @@ -99,6 +102,7 @@ import_widget_add_accounts_to_model (EmpathyImportWidget *self) GtkTreeIter iter; GList *l; EmpathyImportWidgetPriv *priv = GET_PRIV (self); + gint min, natural; manager = tp_account_manager_dup (); @@ -141,6 +145,11 @@ import_widget_add_accounts_to_model (EmpathyImportWidget *self) } + /* Display as much rows as possible */ + gtk_widget_get_preferred_height (priv->treeview, &min, &natural); + gtk_widget_set_size_request (priv->scrolledwindow, -1, + MIN (natural, MAX_TREEVIEW_HEIGHT)); + g_object_unref (manager); } @@ -434,6 +443,7 @@ do_constructed (GObject *obj) gui = empathy_builder_get_file (filename, "widget_vbox", &priv->vbox, "treeview", &priv->treeview, + "scrolledwindow", &priv->scrolledwindow, NULL); g_free (filename); |