Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evince/ChangeLog,v
retrieving revision 1.205
diff -u -u -r1.205 ChangeLog
--- ChangeLog	23 Feb 2005 14:18:37 -0000	1.205
+++ ChangeLog	23 Feb 2005 17:22:27 -0000
@@ -1,3 +1,10 @@
+2005-02-23  Carlos Garcia Campos <carlosgc@gnome.org>
+
+	* shell/ev-window.c: Remember the sidebar size
+
+	* data/evince.schemas.in: Add a new gconf key to store the size of
+	the sidebar
+
 2005-02-23  Marco Pesenti Gritti  <marco@gnome.org>
 
 	* shell/ev-window.c: (ev_window_init):
Index: data/evince.schemas.in
===================================================================
RCS file: /cvs/gnome/evince/data/evince.schemas.in,v
retrieving revision 1.2
diff -u -u -r1.2 evince.schemas.in
--- data/evince.schemas.in	7 Feb 2005 15:59:28 -0000	1.2
+++ data/evince.schemas.in	23 Feb 2005 17:22:27 -0000
@@ -33,5 +33,16 @@
         <long>Show statusbar by default.</long>
       </locale>
     </schema>
+    <schema>
+      <key>/schemas/apps/evince/sidebar_size</key>
+      <applyto>/apps/evince/sidebar_size</applyto>
+      <owner>evince</owner>
+      <type>int</type>
+      <default>132</default>
+      <locale name="C">
+        <short>Sidebar size by default</short>
+        <long>Sidebar size by default.</long>
+      </locale>
+    </schema>
   </schemalist>
 </gconfschemafile>
Index: shell/ev-window.c
===================================================================
RCS file: /cvs/gnome/evince/shell/ev-window.c,v
retrieving revision 1.73
diff -u -u -r1.73 ev-window.c
--- shell/ev-window.c	23 Feb 2005 14:18:37 -0000	1.73
+++ shell/ev-window.c	23 Feb 2005 17:22:29 -0000
@@ -82,6 +82,7 @@
 	GtkWidget *toolbar;
 	GtkWidget *hpaned;
 	GtkWidget *sidebar;
+	gint sidebar_size;
 	GtkWidget *thumbs_sidebar;
 	GtkWidget *find_bar;
 	GtkWidget *scrolled_window;
@@ -125,6 +126,9 @@
 #define GCONF_CHROME_SIDEBAR	"/apps/evince/show_sidebar"
 #define GCONF_CHROME_STATUSBAR	"/apps/evince/show_statusbar"
 
+#define GCONF_SIDEBAR_SIZE      "/apps/evince/sidebar_size"
+#define SIDEBAR_DEFAULT_SIZE    132
+
 static void     ev_window_update_fullscreen_popup (EvWindow         *window);
 static void     ev_window_set_page_mode           (EvWindow         *window,
 						   EvWindowPageMode  page_mode);
@@ -218,6 +222,8 @@
 static void
 set_widget_visibility (GtkWidget *widget, gboolean visible)
 {
+	g_return_if_fail (GTK_IS_WIDGET (widget));
+	
 	if (visible)
 		gtk_widget_show (widget);
 	else
@@ -1027,6 +1033,13 @@
 }
 
 static void
+ev_window_sidebar_position_change_cb (GObject *object, GParamSpec *pspec,
+				      EvWindow *ev_window)
+{
+	ev_window->priv->sidebar_size = gtk_paned_get_position (GTK_PANED (object));
+}
+
+static void
 destroy_fullscreen_popup (EvWindow *window)
 {
 	if (window->priv->fullscreen_popup != NULL)
@@ -1839,6 +1852,7 @@
 {
 	EvWindow *window = EV_WINDOW (object);
 	EvWindowPrivate *priv = window->priv;
+	GConfClient *client;
 
 	if (priv->ui_manager) {
 		g_object_unref (priv->ui_manager);
@@ -1875,6 +1889,10 @@
 		priv->password_uri = NULL;
 	}
 
+	client = gconf_client_get_default ();
+	gconf_client_set_int (client, GCONF_SIDEBAR_SIZE, priv->sidebar_size, NULL);
+	g_object_unref (client);
+
 	destroy_fullscreen_popup (window);
 
 	G_OBJECT_CLASS (ev_window_parent_class)->dispose (object);
@@ -2142,6 +2160,8 @@
 	GtkAccelGroup *accel_group;
 	GError *error = NULL;
 	GtkWidget *sidebar_widget, *toolbar_dock;
+	GConfValue *value;
+	GConfClient *client;
 
 	ev_window->priv = EV_WINDOW_GET_PRIVATE (ev_window);
 
@@ -2218,16 +2238,31 @@
 
 	/* Add the main area */
 	ev_window->priv->hpaned = gtk_hpaned_new ();
+	g_signal_connect (ev_window->priv->hpaned,
+			  "notify::position",
+			  G_CALLBACK (ev_window_sidebar_position_change_cb),
+			  ev_window);
+	
+	ev_window->priv->sidebar_size = SIDEBAR_DEFAULT_SIZE;
+	client = gconf_client_get_default ();
+	value = gconf_client_get (client, GCONF_SIDEBAR_SIZE, NULL);
+	if (value != NULL) {
+		if (value->type == GCONF_VALUE_INT) {
+			ev_window->priv->sidebar_size = gconf_value_get_int (value);
+		}
+		gconf_value_free (value);
+	}
+	g_object_unref (client);
+	gtk_paned_set_position (GTK_PANED (ev_window->priv->hpaned),
+				ev_window->priv->sidebar_size);
 	gtk_box_pack_start (GTK_BOX (ev_window->priv->main_box), ev_window->priv->hpaned,
-			    TRUE, TRUE, 0);	
+			    TRUE, TRUE, 0);
+	gtk_widget_show (ev_window->priv->hpaned);
+	
 	ev_window->priv->sidebar = ev_sidebar_new ();
-	g_signal_connect (ev_window->priv->sidebar,
-			  "notify::visible",
-			  G_CALLBACK (ev_window_sidebar_visibility_changed_cb),
-			  ev_window);
 	gtk_paned_pack1 (GTK_PANED (ev_window->priv->hpaned),
 			 ev_window->priv->sidebar, FALSE, FALSE);
-	gtk_widget_show (ev_window->priv->hpaned);
+	gtk_widget_show (ev_window->priv->sidebar);
 
 	/* Stub sidebar, for now */
 	sidebar_widget = ev_sidebar_links_new ();
@@ -2302,6 +2337,12 @@
 	set_chrome_actions (ev_window);
 	update_chrome_visibility (ev_window);
 
+	/* Connect sidebar signals */
+	g_signal_connect (ev_window->priv->sidebar,
+			  "notify::visible",
+			  G_CALLBACK (ev_window_sidebar_visibility_changed_cb),
+			  ev_window);
+	
 	/* Connect to find bar signals */
 	g_signal_connect (ev_window->priv->find_bar,
 			  "previous",
