aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
authorMike Kestner <mkestner@ximian.com>2003-05-10 01:14:17 +0800
committerMike Kestner <mkestner@src.gnome.org>2003-05-10 01:14:17 +0800
commit4d311889344a6106f5ca8913c6d107cc47119862 (patch)
tree27ed5759fb43c7e89fa27ad3850e18640ba89ff4 /widgets/table
parentcc7acff2e20a893b5616a8fde92a371547aa10f6 (diff)
downloadgsoc2013-evolution-4d311889344a6106f5ca8913c6d107cc47119862.tar
gsoc2013-evolution-4d311889344a6106f5ca8913c6d107cc47119862.tar.gz
gsoc2013-evolution-4d311889344a6106f5ca8913c6d107cc47119862.tar.bz2
gsoc2013-evolution-4d311889344a6106f5ca8913c6d107cc47119862.tar.lz
gsoc2013-evolution-4d311889344a6106f5ca8913c6d107cc47119862.tar.xz
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')
-rw-r--r--widgets/table/e-table-item.c2
-rw-r--r--widgets/table/e-tree.c13
2 files changed, 13 insertions, 2 deletions
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 44aeecebb2..30c03d0c90 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -3121,7 +3121,7 @@ eti_cursor_change (ESelectionModel *selection, int row, int col, ETableItem *eti
if (eti->old_cursor_row != -1 && view_row != eti->old_cursor_row)
e_table_item_redraw_row (eti, eti->old_cursor_row);
- if (view_row == -1 || view_col == -1) {
+ if (view_row == -1) {
e_table_item_leave_edit_(eti);
eti->old_cursor_row = -1;
return;
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;