# HG changeset patch
# Node ID 451634cf0f35
# Parent  52e89cce1dc7
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -965,6 +965,7 @@ version 3.0.0 (??/??/????):
 		* pidgin_idle_get_ui_ops
 		* pidgin_load_accels
 		* pidgin_make_mini_dialog_with_custom_icon
+		* pidgin_make_scrollable
 		* pidgin_mini_dialog_new_with_custom_icon
 		* pidgin_mini_dialog_set_custom_icon
 		* pidgin_make_pretty_arrows
diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c
--- a/pidgin/gtkblist.c
+++ b/pidgin/gtkblist.c
@@ -3087,7 +3087,7 @@ static void pidgin_blist_show(PurpleBudd
 {
 	GSimpleActionGroup *action_group = NULL;
 	void *handle;
-	GtkWidget *sep;
+	GtkWidget *sep, *sw;
 	GtkEventController *key_controller = NULL;
 	GtkTreeSelection *selection;
 
@@ -3163,9 +3163,15 @@ static void pidgin_blist_show(PurpleBudd
 	gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(gtkblist->treeview),
 			pidgin_blist_search_equal_func, NULL, NULL);
 
-	gtk_box_pack_start(GTK_BOX(gtkblist->vbox),
-		pidgin_make_scrollable(gtkblist->treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, -1, -1),
-		TRUE, TRUE, 0);
+	sw = gtk_scrolled_window_new();
+	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
+	                               GTK_POLICY_AUTOMATIC,
+	                               GTK_POLICY_AUTOMATIC);
+	gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), gtkblist->treeview);
+
+	gtk_widget_set_vexpand(sw, TRUE);
+	gtk_widget_set_valign(sw, GTK_ALIGN_FILL);
+	gtk_box_append(GTK_BOX(gtkblist->vbox), sw);
 
 	sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
 	gtk_box_pack_start(GTK_BOX(gtkblist->vbox), sep, FALSE, FALSE, 0);
diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c
--- a/pidgin/gtkrequest.c
+++ b/pidgin/gtkrequest.c
@@ -1181,7 +1181,11 @@ create_string_field(PurpleRequestField *
 							 G_CALLBACK(req_entry_field_changed_cb), field);
 	    }
 
-		widget = pidgin_make_scrollable(textview, GTK_POLICY_NEVER, GTK_POLICY_ALWAYS, -1, 75);
+		widget = gtk_scrolled_window_new();
+		gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(widget),
+		                               GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
+		gtk_widget_set_size_request(widget, -1, 75);
+		gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(widget), textview);
 	}
 	else
 	{
@@ -1454,6 +1458,7 @@ list_field_select_changed_cb(GtkTreeSele
 static GtkWidget *
 create_list_field(PurpleRequestField *field)
 {
+	GtkWidget *sw;
 	GtkWidget *treeview;
 	GtkListStore *store;
 	GtkCellRenderer *renderer;
@@ -1540,7 +1545,12 @@ create_list_field(PurpleRequestField *fi
 	g_signal_connect(G_OBJECT(sel), "changed",
 					 G_CALLBACK(list_field_select_changed_cb), field);
 
-	return pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, -1, -1);
+
+	sw = gtk_scrolled_window_new();
+	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
+	                               GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+	gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), treeview);
+	return sw;
 }
 
 static GdkPixbuf*
diff --git a/pidgin/gtkutils.h b/pidgin/gtkutils.h
--- a/pidgin/gtkutils.h
+++ b/pidgin/gtkutils.h
@@ -276,20 +276,6 @@ gboolean pidgin_auto_parent_window(GtkWi
  */
 GtkWidget *pidgin_add_widget_to_vbox(GtkBox *vbox, const char *widget_label, GtkSizeGroup *sg, GtkWidget *widget, gboolean expand, GtkWidget **p_label);
 
-/**
- * pidgin_make_scrollable:
- * @child:              The child widget
- * @hscrollbar_policy:  Horizontal scrolling policy
- * @vscrollbar_policy:  Vertical scrolling policy
- * @width:              Desired widget width, or -1 for default
- * @height:             Desired widget height, or -1 for default
- *
- * Add scrollbars to a widget
- *
- * Returns: (transfer full): A scrolled window with @child packed inside of it.
- */
-GtkWidget *pidgin_make_scrollable(GtkWidget *child, GtkPolicyType hscrollbar_policy, GtkPolicyType vscrollbar_policy, int width, int height);
-
 G_END_DECLS
 
 #endif /* _PIDGINUTILS_H_ */
diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c
--- a/pidgin/gtkutils.c
+++ b/pidgin/gtkutils.c
@@ -1164,23 +1164,3 @@ gboolean pidgin_auto_parent_window(GtkWi
 	return FALSE;
 #endif
 }
-
-GtkWidget *
-pidgin_make_scrollable(GtkWidget *child, GtkPolicyType hscrollbar_policy, GtkPolicyType vscrollbar_policy, int width, int height)
-{
-	GtkWidget *sw = gtk_scrolled_window_new();
-
-	if (G_LIKELY(sw)) {
-		gtk_widget_show(sw);
-		gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), hscrollbar_policy, vscrollbar_policy);
-		if (width != -1 || height != -1)
-			gtk_widget_set_size_request(sw, width, height);
-		if (child) {
-			gtk_container_add(GTK_CONTAINER(sw), child);
-		}
-		return sw;
-	}
-
-	return child;
-}
-
diff --git a/pidgin/plugins/spellchk.c b/pidgin/plugins/spellchk.c
--- a/pidgin/plugins/spellchk.c
+++ b/pidgin/plugins/spellchk.c
@@ -2108,6 +2108,7 @@ static GtkWidget *
 get_config_frame(PurplePlugin *plugin)
 {
 	GtkWidget *ret, *vbox;
+	GtkWidget *sw;
 	GtkWidget *hbox;
 	GtkWidget *button;
 	GtkSizeGroup *sg;
@@ -2181,10 +2182,14 @@ get_config_frame(PurplePlugin *plugin)
 
 	gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)),
 		 GTK_SELECTION_MULTIPLE);
-	gtk_box_pack_start(GTK_BOX(vbox),
-		pidgin_make_scrollable(tree, GTK_POLICY_NEVER, GTK_POLICY_ALWAYS, GTK_SHADOW_IN, -1, -1),
-		TRUE, TRUE, 0);
-	gtk_widget_show(tree);
+
+	sw = gtk_scrolled_window_new();
+	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER,
+	                               GTK_POLICY_ALWAYS);
+	gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), tree);
+	gtk_widget_set_vexpand(sw, TRUE);
+	gtk_widget_set_valign(sw, GTK_ALIGN_FILL);
+	gtk_box_append(GTK_BOX(vbox), sw);
 
 	hbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
 	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
