[Nautilus-list] [PATCH] makes the hide sidebar work



hi

	This patch makes the sidebar to be completely hidden when selecting so
from the preferences or from then menu.

regards
Diego

Index: nautilus-horizontal-splitter.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-horizontal-splitter.c,v
retrieving revision 1.19
diff -u -r1.19 nautilus-horizontal-splitter.c
--- nautilus-horizontal-splitter.c	2001/11/10 05:00:33	1.19
+++ nautilus-horizontal-splitter.c	2002/03/02 17:31:55
@@ -80,6 +80,7 @@
 	}
 	
 	gtk_paned_set_position (GTK_PANED (splitter), position);
+	gtk_widget_show (GTK_PANED (splitter)->child1);
 }
 
 static void
@@ -103,10 +104,29 @@
 	}
 }
 
+static void
+splitter_hide (NautilusHorizontalSplitter *splitter, int position)
+{
+	GtkPaned *parent;
+	
+	parent = GTK_PANED (splitter);
+
+	gtk_widget_hide (parent->child1);
+
+	splitter->details->saved_size = position;
+	gtk_paned_set_position (GTK_PANED (splitter), 0);
+}
+
 void
 nautilus_horizontal_splitter_expand (NautilusHorizontalSplitter *splitter)
 {
 	splitter_expand (splitter, gtk_paned_get_position (GTK_PANED (splitter)));
+}
+
+void
+nautilus_horizontal_splitter_hide (NautilusHorizontalSplitter *splitter)
+{
+	splitter_hide (splitter, gtk_paned_get_position (GTK_PANED (splitter)));
 }
 
 void
Index: nautilus-horizontal-splitter.h
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-horizontal-splitter.h,v
retrieving revision 1.8
diff -u -r1.8 nautilus-horizontal-splitter.h
--- nautilus-horizontal-splitter.h	2001/11/08 23:09:32	1.8
+++ nautilus-horizontal-splitter.h	2002/03/02 17:31:55
@@ -51,6 +51,7 @@
 GtkWidget *nautilus_horizontal_splitter_new      (void);
 
 void	   nautilus_horizontal_splitter_collapse	(NautilusHorizontalSplitter *splitter);
+void	   nautilus_horizontal_splitter_hide		(NautilusHorizontalSplitter *splitter);
 void	   nautilus_horizontal_splitter_expand		(NautilusHorizontalSplitter *splitter);
 void	   nautilus_horizontal_splitter_toggle_position	(NautilusHorizontalSplitter *splitter);
 
Index: nautilus-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window.c,v
retrieving revision 1.371
diff -u -r1.371 nautilus-window.c
--- nautilus-window.c	2002/03/01 22:57:33	1.371
+++ nautilus-window.c	2002/03/02 17:33:06
@@ -2067,7 +2067,7 @@
 	if (window->sidebar == NULL) {
 		return;
 	}
-	nautilus_horizontal_splitter_collapse
+	nautilus_horizontal_splitter_hide
 		(NAUTILUS_HORIZONTAL_SPLITTER (window->content_hbox));
 	nautilus_window_update_show_hide_menu_items (window);
 }


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