diff options
author | Mike Kestner <mkestner@ximian.com> | 2003-05-10 01:14:17 +0800 |
---|---|---|
committer | Mike Kestner <mkestner@src.gnome.org> | 2003-05-10 01:14:17 +0800 |
commit | 4d311889344a6106f5ca8913c6d107cc47119862 (patch) | |
tree | 27ed5759fb43c7e89fa27ad3850e18640ba89ff4 /widgets/table/e-tree.c | |
parent | cc7acff2e20a893b5616a8fde92a371547aa10f6 (diff) | |
download | gsoc2013-evolution-4d311889344a6106f5ca8913c6d107cc47119862.tar.gz gsoc2013-evolution-4d311889344a6106f5ca8913c6d107cc47119862.tar.zst gsoc2013-evolution-4d311889344a6106f5ca8913c6d107cc47119862.zip |
don't return on col == -1. update the adjustment to center the cursor.
2003-05-09 Mike Kestner <mkestner@ximian.com>
* e-table-item.c (eti_cursor_change): don't return on col == -1.
* e-tree.c (tree_canvas_size_allocate): update the adjustment
to center the cursor.
(hover_timeout): remove unused variable to fix warning
svn path=/trunk/; revision=21142
Diffstat (limited to 'widgets/table/e-tree.c')
-rw-r--r-- | widgets/table/e-tree.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index bb7e0f44cc..b0c20a4b09 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -747,6 +747,9 @@ tree_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, gdouble width; gdouble height; gdouble item_height; + GtkAdjustment *adj = GTK_LAYOUT(e_tree->priv->table_canvas)->vadjustment; + ETreePath path = e_tree_get_cursor (e_tree); + gint x, y, w, h; GValue *val = g_new0 (GValue, 1); g_value_init (val, G_TYPE_DOUBLE); @@ -763,6 +766,15 @@ tree_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, NULL); g_object_set_property (G_OBJECT (e_tree->priv->header), "width", val); g_free (val); + + if (path) + e_tree_get_cell_geometry (e_tree, e_tree_row_of_node(e_tree, path), 0, &x, &y, &w, &h); + else + y = h = 0; + + if (y < adj->value || y + h > adj->value + adj->page_size) + gtk_adjustment_set_value(adj, CLAMP(y - adj->page_size / 2, adj->lower, adj->upper - adj->page_size)); + if (e_tree->priv->reflow_idle_id) g_source_remove(e_tree->priv->reflow_idle_id); tree_canvas_reflow_idle(e_tree); @@ -2716,7 +2728,6 @@ static gboolean hover_timeout (gpointer data) { ETree *et = data; - GtkWidget *widget = data; int x = et->priv->hover_x; int y = et->priv->hover_y; int row, col; |