[nautilus] Better split view size allocation



commit 7fb432ba6b6816076e9eb5cd6f586df2e90ed33a
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Dec 14 14:02:08 2009 +0100

    Better split view size allocation
    
    Ensure that the views always get *some* size so that we can at least
    always see the scrollbars, etc.
    
    Also make the toplevel size of a pane be a fixed size, thus guaranteeing
    the two panes in a split view return the same size request, thereby
    guaranteeing a default (if unset by user) position of 50%. Without this
    we could get e.g. a size request from the tabs or the location bar size
    change causing a change in the view splitter position.

 src/nautilus-navigation-window-pane.c |    6 ++++++
 src/nautilus-navigation-window.c      |    6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-navigation-window-pane.c b/src/nautilus-navigation-window-pane.c
index 106057a..93551a8 100644
--- a/src/nautilus-navigation-window-pane.c
+++ b/src/nautilus-navigation-window-pane.c
@@ -672,6 +672,12 @@ nautilus_navigation_window_pane_setup (NautilusNavigationWindowPane *pane)
 	gtk_notebook_set_show_border (GTK_NOTEBOOK (pane->notebook), FALSE);
 	gtk_widget_show (pane->notebook);
 	gtk_container_set_border_width (GTK_CONTAINER (pane->notebook), 0);
+
+	/* Ensure that the view has some minimal size and that other parts
+	 * of the UI (like location bar and tabs) don't request more and
+	 * thus affect the default position of the split view paned.
+	 */
+	gtk_widget_set_size_request (pane->widget, 60, 60);
 }
 
 
diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c
index 7ce9f23..f8a32bc 100644
--- a/src/nautilus-navigation-window.c
+++ b/src/nautilus-navigation-window.c
@@ -176,7 +176,7 @@ nautilus_navigation_window_init (NautilusNavigationWindow *window)
 
 	nautilus_navigation_window_pane_setup (pane);
 
-	gtk_paned_pack1 (GTK_PANED(hpaned), pane->widget, TRUE, TRUE);
+	gtk_paned_pack1 (GTK_PANED(hpaned), pane->widget, TRUE, FALSE);
 	gtk_widget_show (pane->widget);
 
 	/* this has to be done after the location bar has been set up,
@@ -1282,9 +1282,9 @@ create_extra_pane (NautilusNavigationWindow *window)
 
 	paned = GTK_PANED (window->details->split_view_hpane);
 	if (gtk_paned_get_child1 (paned) == NULL) {
-		gtk_paned_pack1 (paned, pane->widget, TRUE, TRUE);
+		gtk_paned_pack1 (paned, pane->widget, TRUE, FALSE);
 	} else {
-		gtk_paned_pack2 (paned, pane->widget, TRUE, TRUE);
+		gtk_paned_pack2 (paned, pane->widget, TRUE, FALSE);
 	}
 
 	/* slot */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]