[nautilus] Move the navigation bar size group to be a cross window header size group



commit 89c29e1beb04b7f0cc751976bff052af26faf8cd
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Dec 17 21:24:26 2009 +0100

    Move the navigation bar size group to be a cross window header size group
    
    This way we can make sure we align the headers of the sidebar too.

 src/nautilus-navigation-window-pane.c |   10 +++++-----
 src/nautilus-navigation-window-pane.h |    1 -
 src/nautilus-navigation-window.c      |    9 +++++++++
 src/nautilus-side-pane.c              |    9 ++++++---
 src/nautilus-window-private.h         |    2 ++
 5 files changed, 22 insertions(+), 9 deletions(-)
---
diff --git a/src/nautilus-navigation-window-pane.c b/src/nautilus-navigation-window-pane.c
index 16e9d06..4d13ec4 100644
--- a/src/nautilus-navigation-window-pane.c
+++ b/src/nautilus-navigation-window-pane.c
@@ -621,6 +621,7 @@ nautilus_navigation_window_pane_setup (NautilusNavigationWindowPane *pane)
 {
 	GtkWidget *hbox;
 	NautilusEntry *entry;
+	GtkSizeGroup *header_size_group;
 
 	pane->widget = gtk_vbox_new (FALSE, 0);
 
@@ -631,11 +632,10 @@ nautilus_navigation_window_pane_setup (NautilusNavigationWindowPane *pane)
 			    FALSE, FALSE, 0);
 	gtk_widget_show (hbox);
 
-	pane->navigation_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
-	gtk_size_group_set_ignore_hidden (pane->navigation_group, FALSE);
+	header_size_group = NAUTILUS_NAVIGATION_WINDOW (NAUTILUS_WINDOW_PANE (pane)->window)->details->header_size_group;
 
 	pane->path_bar = g_object_new (NAUTILUS_TYPE_PATH_BAR, NULL);
-	gtk_size_group_add_widget (pane->navigation_group, pane->path_bar);
+	gtk_size_group_add_widget (header_size_group, pane->path_bar);
 	gtk_widget_show (pane->path_bar);
 
 	g_signal_connect_object (pane->path_bar, "path_clicked",
@@ -648,7 +648,7 @@ nautilus_navigation_window_pane_setup (NautilusNavigationWindowPane *pane)
 			    TRUE, TRUE, 0);
 
 	pane->navigation_bar = nautilus_location_bar_new (pane);
-	gtk_size_group_add_widget (pane->navigation_group, pane->navigation_bar);
+	gtk_size_group_add_widget (header_size_group, pane->navigation_bar);
 	g_signal_connect_object (pane->navigation_bar, "location_changed",
 				 G_CALLBACK (navigation_bar_location_changed_callback), pane, 0);
 	g_signal_connect_object (pane->navigation_bar, "cancel",
@@ -662,7 +662,7 @@ nautilus_navigation_window_pane_setup (NautilusNavigationWindowPane *pane)
 			    TRUE, TRUE, 0);
 
 	pane->search_bar = nautilus_search_bar_new ();
-	gtk_size_group_add_widget (pane->navigation_group, pane->search_bar);
+	gtk_size_group_add_widget (header_size_group, pane->search_bar);
 	g_signal_connect_object (pane->search_bar, "activate",
 				 G_CALLBACK (search_bar_activate_callback), pane, 0);
 	g_signal_connect_object (pane->search_bar, "cancel",
diff --git a/src/nautilus-navigation-window-pane.h b/src/nautilus-navigation-window-pane.h
index ef3abea..7600f41 100644
--- a/src/nautilus-navigation-window-pane.h
+++ b/src/nautilus-navigation-window-pane.h
@@ -49,7 +49,6 @@ struct _NautilusNavigationWindowPane {
 
 	/* location bar */
 	GtkWidget *location_bar;
-	GtkSizeGroup *navigation_group;
 	GtkWidget *navigation_bar;
 	GtkWidget *path_bar;
 	GtkWidget *search_bar;
diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c
index d197f5b..2d37bb5 100644
--- a/src/nautilus-navigation-window.c
+++ b/src/nautilus-navigation-window.c
@@ -139,6 +139,9 @@ nautilus_navigation_window_init (NautilusNavigationWindow *window)
 	pane = nautilus_navigation_window_pane_new (win);
 	win->details->panes = g_list_prepend (win->details->panes, pane);
 
+	window->details->header_size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
+	gtk_size_group_set_ignore_hidden (window->details->header_size_group, FALSE);
+
 	window->details->content_paned = nautilus_horizontal_splitter_new ();
 	gtk_table_attach (GTK_TABLE (NAUTILUS_WINDOW (window)->details->table),
 			  window->details->content_paned,
@@ -456,8 +459,14 @@ side_pane_switch_page_callback (NautilusSidePane *side_pane,
 static void
 nautilus_navigation_window_set_up_sidebar (NautilusNavigationWindow *window)
 {
+	GtkWidget *title;
+
 	window->sidebar = nautilus_side_pane_new ();
 
+	title = nautilus_side_pane_get_title (window->sidebar);
+	gtk_size_group_add_widget (window->details->header_size_group,
+				   title);
+
 	gtk_paned_pack1 (GTK_PANED (window->details->content_paned),
 			 GTK_WIDGET (window->sidebar),
 			 FALSE, TRUE);
diff --git a/src/nautilus-side-pane.c b/src/nautilus-side-pane.c
index 68ba97d..341c768 100644
--- a/src/nautilus-side-pane.c
+++ b/src/nautilus-side-pane.c
@@ -41,7 +41,7 @@ typedef struct {
 struct _NautilusSidePaneDetails {
 	GtkWidget *notebook;
 	GtkWidget *menu;
-	
+
 	GtkWidget *title_frame;
 	GtkWidget *title_hbox;
 	GtkWidget *title_label;
@@ -316,12 +316,15 @@ nautilus_side_pane_init (GObject *object)
 
 	side_pane->details = G_TYPE_INSTANCE_GET_PRIVATE (object, NAUTILUS_TYPE_SIDE_PANE, NautilusSidePaneDetails);
 
-	frame = gtk_frame_new (NULL);
+	/* The frame (really a vbox) has the border */
+	frame = gtk_vbox_new (FALSE, 0);
+	gtk_container_set_border_width (GTK_CONTAINER (frame), 4);
 	side_pane->details->title_frame = frame;
-	gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_NONE);
 	gtk_widget_show (frame);
 	gtk_box_pack_start (GTK_BOX (side_pane), frame, FALSE, FALSE, 0);
 
+	/* And the title_hbox is what gets the same size as the other
+	   headers */
 	hbox = gtk_hbox_new (FALSE, 0);
 	side_pane->details->title_hbox = hbox;
 	gtk_widget_show (hbox);
diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h
index bd82626..4580afc 100644
--- a/src/nautilus-window-private.h
+++ b/src/nautilus-window-private.h
@@ -87,6 +87,8 @@ struct _NautilusNavigationWindowDetails {
         GtkWidget *content_paned;
         GtkWidget *content_box;
         GtkActionGroup *navigation_action_group; /* owned by ui_manager */
+
+        GtkSizeGroup *header_size_group;
         
         /* Side Pane */
         int side_pane_width;



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