]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Keep window size for new notebook pages
authorDirk Hohndel <dirk@hohndel.org>
Thu, 20 Oct 2011 10:04:18 +0000 (03:04 -0700)
committerDirk Hohndel <dirk@hohndel.org>
Thu, 20 Oct 2011 10:04:18 +0000 (03:04 -0700)
We used to set a fixed size instead of just copying the size that the
existing notebook has - which didn't really feel right when resizing and
then ripping of a page.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
gtk-gui.c

index d3de7a649a4ead34c59fb75a073c634b6a8be2fa..351e7b9f4812d717cafc06e83b19e583c39877ef 100644 (file)
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -529,6 +529,7 @@ static GtkNotebook *create_new_notebook_window(GtkNotebook *source,
 {
        GtkWidget *win, *notebook, *vbox;
        notebook_data_t *nbdp;
+       GtkAllocation allocation;
 
        /* pick the right notebook page data and return if both are detached */
        if (nbd[0].widget == NULL)
@@ -556,7 +557,8 @@ static GtkNotebook *create_new_notebook_window(GtkNotebook *source,
        /* disallow drop events */
        gtk_drag_dest_set(notebook, 0, NULL, 0, 0);
        gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 6);
-       gtk_widget_set_size_request(notebook, 450, 350);
+       gtk_widget_get_allocation(page, &allocation);
+       gtk_widget_set_size_request(notebook, allocation.width, allocation.height);
 
        gtk_widget_show_all(win);
        return GTK_NOTEBOOK(notebook);