summary refs log tree commit diff stats
path: root/src/fe-gtk
diff options
context:
space:
mode:
authorPatrick Griffis <tingping@tingping.se>2016-12-22 07:31:55 -0500
committerPatrick Griffis <tingping@tingping.se>2016-12-22 07:32:44 -0500
commit2c80cb7efde327931976112bd4c0127e8a70ac61 (patch)
treefbf1593f196c693133df59edfb9af9759ca8e649 /src/fe-gtk
parent4c178782a779f013fafab476506f7d4dae372b8a (diff)
Use a scrolled window for large preference pages
Closes #1722
Diffstat (limited to 'src/fe-gtk')
-rw-r--r--src/fe-gtk/setup.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/fe-gtk/setup.c b/src/fe-gtk/setup.c
index 265c979c..0070a9bb 100644
--- a/src/fe-gtk/setup.c
+++ b/src/fe-gtk/setup.c
@@ -1840,7 +1840,8 @@ setup_create_sound_page (void)
 static void
 setup_add_page (const char *title, GtkWidget *book, GtkWidget *tab)
 {
-	GtkWidget *label, *vvbox;
+	GtkWidget *label, *vvbox, *viewport;
+	GtkScrolledWindow *sw;
 	char buf[128];
 
 	vvbox = gtk_vbox_new (FALSE, 0);
@@ -1855,7 +1856,15 @@ setup_add_page (const char *title, GtkWidget *book, GtkWidget *tab)
 
 	gtk_container_add (GTK_CONTAINER (vvbox), tab);
 
-	gtk_notebook_append_page (GTK_NOTEBOOK (book), vvbox, NULL);
+	sw = GTK_SCROLLED_WINDOW(gtk_scrolled_window_new (NULL, NULL));
+	gtk_scrolled_window_set_shadow_type (sw, GTK_SHADOW_NONE);
+	gtk_scrolled_window_set_policy (sw, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+	gtk_scrolled_window_add_with_viewport (sw, vvbox);
+
+	viewport = gtk_bin_get_child (GTK_BIN(sw));
+	gtk_viewport_set_shadow_type (GTK_VIEWPORT(viewport), GTK_SHADOW_NONE);
+
+	gtk_notebook_append_page (GTK_NOTEBOOK (book), GTK_WIDGET(sw), NULL);
 }
 
 static const char *const cata[] =
@@ -2279,7 +2288,7 @@ setup_window_open (void)
 {
 	GtkWidget *wid, *win, *vbox, *hbox, *hbbox;
 
-	win = gtkutil_window_new (_(DISPLAY_NAME": Preferences"), "prefs", 0, 0, 2);
+	win = gtkutil_window_new (_(DISPLAY_NAME": Preferences"), "prefs", 0, 600, 2);
 
 	vbox = gtk_vbox_new (FALSE, 5);
 	gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);