Index: planner-gantt-view.c
===================================================================
RCS file: /cvs/gnome/planner/src/planner-gantt-view.c,v
retrieving revision 1.28
diff -u -r1.28 planner-gantt-view.c
--- planner-gantt-view.c	23 Apr 2005 10:33:09 -0000	1.28
+++ planner-gantt-view.c	31 Mar 2006 20:53:49 -0000
@@ -86,6 +86,9 @@
 							   gpointer           data);
 static void          gantt_view_edit_columns_cb           (GtkAction         *action,
 							   gpointer           data);
+static gboolean      gantt_view_expose_cb                 (GtkWidget      *widget,
+							   GdkEventExpose *event,
+							   gpointer        user_data);
 static void          gantt_view_update_row_height         (PlannerGanttView  *view);
 static void          gantt_view_tree_style_set_cb         (GtkWidget         *tree,
 							   GtkStyle          *prev_style,
@@ -553,6 +556,11 @@
 			  G_CALLBACK (gantt_view_tree_style_set_cb),
 			  view);
 
+	g_signal_connect_after (tree,
+				"expose_event",
+				G_CALLBACK (gantt_view_expose_cb),
+				view);
+
 	g_signal_connect (tree,
 			  "selection_changed",
 			  G_CALLBACK (gantt_view_selection_changed_cb),
@@ -842,6 +850,55 @@
 				    GTK_TREE_VIEW (priv->tree));
 }
 
+static gboolean
+gantt_view_expose_cb (GtkWidget      *widget,
+		      GdkEventExpose *event,
+		      gpointer        data)
+{
+	PlannerGanttView     *view = PLANNER_GANTT_VIEW (data);
+	PlannerGanttViewPriv *priv = view->priv;
+	GtkTreeView          *tv = GTK_TREE_VIEW (priv->tree);
+	GtkWidget            *gantt = priv->gantt;
+	gint                  row_height;
+	gint                  header_height;
+	GList                *cols, *l;
+	GtkTreeViewColumn    *col;
+	GtkRequisition        req;
+	GtkTreePath          *path;
+	GdkRectangle          rect;
+
+	/* Get the row and header heights. */
+	cols = gtk_tree_view_get_columns (tv);
+	row_height = 0;
+	header_height = 0;
+
+	path = gtk_tree_path_new_first ();
+	
+	for (l = cols; l; l = l->next) {
+		col = l->data;
+
+		gtk_widget_size_request (col->button, &req);
+		header_height = MAX (header_height, req.height);
+
+		gtk_tree_view_get_background_area (tv,
+						   path,
+						   col,
+						   &rect);
+		row_height = MAX (row_height, rect.height);
+	}
+
+	if (path)
+		gtk_tree_path_free (path);
+
+	/* Sync with the gantt widget. */
+	g_object_set (gantt,
+		      "header_height", header_height,
+		      "row_height", row_height,
+		      NULL);
+
+	return FALSE;
+}
+
 static void
 gantt_view_update_row_height (PlannerGanttView *view)
 {

 
