[gnome-control-center] online-accounts: Don't scroll single entry lists
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] online-accounts: Don't scroll single entry lists
- Date: Sun, 22 Mar 2015 07:00:19 +0000 (UTC)
commit 7509af9d225a2f5ba29b5eda261962be894757ad
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Mar 20 20:16:11 2015 +0100
online-accounts: Don't scroll single entry lists
Create the scrolled window with vertical scrolling turned off. Turn it
on when there are more than one items in the list.
Note that the immediate parent of the list is a GtkViewport, so we
need to explicitly look for the GtkScrolledWindow.
https://bugzilla.gnome.org/show_bug.cgi?id=745584
.../cc-online-accounts-add-account-dialog.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 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 ffadf07..cbc6953 100644
--- a/panels/online-accounts/cc-online-accounts-add-account-dialog.c
+++ b/panels/online-accounts/cc-online-accounts-add-account-dialog.c
@@ -130,7 +130,7 @@ add_account_dialog_create_group_ui (GoaPanelAddAccountDialog *add_account,
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_hexpand (sw, TRUE);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (*group_grid), sw);
@@ -183,10 +183,17 @@ add_account_dialog_create_provider_ui (GoaPanelAddAccountDialog *add_account,
* 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. */
+ * the result is quite similar. For those with only one child,
+ * we turn off the scrolling. */
+
GtkWidget *sw;
- sw = gtk_widget_get_parent (GTK_WIDGET (list_box));
+
+ sw = gtk_widget_get_ancestor (GTK_WIDGET (list_box), GTK_TYPE_SCROLLED_WINDOW);
+ g_assert_nonnull (sw);
+
gtk_widget_set_vexpand (sw, TRUE);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+
g_list_free (children);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]