Re: [evolution-patches] Fix for Task Pane resizing (#55653)



New patch attached to fix the two style issues, as well as the spelling
of realise to realize, to match the GTK+ API.

On Thu, 2004-07-08 at 23:34 +0200, Rodrigo Moya wrote:
> On Thu, 2004-07-08 at 15:44 -0400, Rodney Dawes wrote:
> > This patch fixes bug 55653 and sets the task pane position correctly
> > when we switch to the Tasks component.
> > 

> > +
> > +       gtk_paned_set_position ((GtkPaned *)tasks->priv->paned,
> > calendar_config_get_task_vpane_pos ());
> >  }
> why do you need this call? isn't the pane_realised callback enough?

This is needed so that the pane position gets set correctly when you
start up evolution in mail, and then switch to tasks. There is a comment
in the bug about how just adding the realize handler doesn't work for
the case when you move the task pane, switch to mail or some other
component, exit, start evolution, and switch back to tasks. The calendar
code for the tasks pane is doing the same thing that this patch adds.

> Apart from this, it looks ok to me.
> 
> cheers

-- dobey

Index: gui/e-tasks.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-tasks.c,v
retrieving revision 1.98
diff -u -r1.98 e-tasks.c
--- gui/e-tasks.c	29 Jun 2004 09:54:46 -0000	1.98
+++ gui/e-tasks.c	9 Jul 2004 16:34:24 -0000
@@ -71,6 +71,9 @@
 	/* Calendar search bar for tasks */
 	GtkWidget *search_bar;
 
+	/* Paned widget */
+	GtkWidget *paned;
+
 	/* The preview */
 	GtkWidget *preview;
 	
@@ -436,12 +439,17 @@
 	"</ETableState>"
 
 static void
+pane_realized (GtkWidget *widget, ETasks *tasks)
+{
+	gtk_paned_set_position ((GtkPaned *)widget, calendar_config_get_task_vpane_pos ());
+}
+
+static void
 setup_widgets (ETasks *tasks)
 {
 	ETasksPrivate *priv;
 	ETable *etable;
 	ECalModel *model;
-	GtkWidget *paned;
 
 	priv = tasks->priv;
 
@@ -456,13 +464,14 @@
 	gtk_widget_show (priv->search_bar);
 
 	/* add the paned widget for the task list and task detail areas */
-	paned = gtk_vpaned_new ();
-	gtk_paned_set_position (GTK_PANED (paned), calendar_config_get_task_vpane_pos ());
-	g_signal_connect (G_OBJECT (paned), "button_release_event",
+	priv->paned = gtk_vpaned_new ();
+	g_signal_connect (priv->paned, "realize", G_CALLBACK (pane_realized), tasks);
+
+	g_signal_connect (G_OBJECT (priv->paned), "button_release_event",
 			  G_CALLBACK (vpaned_resized_cb), tasks);
-	gtk_table_attach (GTK_TABLE (tasks), paned, 0, 1, 1, 2,
+	gtk_table_attach (GTK_TABLE (tasks), priv->paned, 0, 1, 1, 2,
 			  GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
-	gtk_widget_show (paned);
+	gtk_widget_show (priv->paned);
 
 	/* create the task list */
 	priv->tasks_view = e_calendar_table_new ();
@@ -471,7 +480,7 @@
 	etable = e_table_scrolled_get_table (
 		E_TABLE_SCROLLED (E_CALENDAR_TABLE (priv->tasks_view)->etable));
 	e_table_set_state (etable, E_TASKS_TABLE_DEFAULT_STATE);
-	gtk_paned_add1 (GTK_PANED (paned), priv->tasks_view);
+	gtk_paned_add1 (GTK_PANED (priv->paned), priv->tasks_view);
 	gtk_widget_show (priv->tasks_view);
 
 
@@ -504,7 +513,7 @@
 	/* create the task detail */
 	priv->preview = e_cal_component_preview_new ();
 	e_cal_component_preview_set_default_timezone (E_CAL_COMPONENT_PREVIEW (priv->preview), calendar_config_get_icaltimezone ());	
-	gtk_paned_add2 (GTK_PANED (paned), priv->preview);
+	gtk_paned_add2 (GTK_PANED (priv->paned), priv->preview);
 	gtk_widget_show (priv->preview);
 
 	model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view));
@@ -1048,6 +1057,8 @@
 	if (GAL_IS_VIEW_ETABLE (view)) {
 		gal_view_etable_attach_table (GAL_VIEW_ETABLE (view), e_table_scrolled_get_table (E_TABLE_SCROLLED (E_CALENDAR_TABLE (tasks->priv->tasks_view)->etable)));
 	}
+
+	gtk_paned_set_position ((GtkPaned *)tasks->priv->paned, calendar_config_get_task_vpane_pos ());
 }
 
 /**


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