aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-item.c
diff options
context:
space:
mode:
authorMike Kestner <mkestner@ximian.com>2003-08-16 04:23:12 +0800
committerMike Kestner <mkestner@src.gnome.org>2003-08-16 04:23:12 +0800
commit405b846e5b5ab98ecb0d1a3545df3972df044730 (patch)
tree556cd9dd50d9d272fc0801d625e7333f0bf28aec /widgets/table/e-table-item.c
parent0595eace5611dd1c9741f7ea94af96f8c55ddc45 (diff)
downloadgsoc2013-evolution-405b846e5b5ab98ecb0d1a3545df3972df044730.tar.gz
gsoc2013-evolution-405b846e5b5ab98ecb0d1a3545df3972df044730.tar.zst
gsoc2013-evolution-405b846e5b5ab98ecb0d1a3545df3972df044730.zip
extracted from ect_draw (draw_expander): new gtktreeview-like expander
2003-08-15 Mike Kestner <mkestner@ximian.com> * e-cell-tree.c (draw_retro_expander): extracted from ect_draw (draw_expander): new gtktreeview-like expander drawing (ect_draw): draw lines and expanders based on retro_look style prop (adjust_event_position): extracted method from ect_event (event_in_expander): new checks for motion/clicks in expander (ect_event): handle prelight for new expanders * e-table-item.c (eti_init): init new motion col/row (eti_event): synthesize leave_notify events for cells and propogate existing motion events to the cells. * e-tree.c (e_tree_class_init): add retro_look and expander_size style props. svn path=/trunk/; revision=22251
Diffstat (limited to 'widgets/table/e-table-item.c')
-rw-r--r--widgets/table/e-table-item.c46
1 files changed, 36 insertions, 10 deletions
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index b125c8495d..ea2dc4297f 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -1558,6 +1558,8 @@ eti_init (GnomeCanvasItem *item)
{
ETableItem *eti = E_TABLE_ITEM (item);
+ eti->motion_row = -1;
+ eti->motion_col = -1;
eti->editing_col = -1;
eti->editing_row = -1;
eti->height = 0;
@@ -2512,7 +2514,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
break;
}
case GDK_MOTION_NOTIFY: {
- int col, row;
+ int col, row, flags;
double x1, y1;
gint cursor_col, cursor_row;
@@ -2536,6 +2538,19 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
if (!find_cell (eti, e->motion.x, e->motion.y, &col, &row, &x1, &y1))
return TRUE;
+ if (eti->motion_row != -1 && eti->motion_col != -1 &&
+ (row != eti->motion_row || col != eti->motion_col)) {
+ GdkEvent *cross = gdk_event_new (GDK_LEAVE_NOTIFY);
+ cross->crossing.time = e->motion.time;
+ return_val = eti_e_cell_event (eti, eti->cell_views [eti->motion_col],
+ cross, cross->crossing.time,
+ view_to_model_col(eti, eti->motion_col),
+ eti->motion_col, eti->motion_row, 0);
+ }
+
+ eti->motion_row = row;
+ eti->motion_col = col;
+
g_object_get(eti->selection,
"cursor_row", &cursor_row,
"cursor_col", &cursor_col,
@@ -2555,18 +2570,21 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
}
#endif
+ flags = 0;
if (cursor_row == view_to_model_row(eti, row) && cursor_col == view_to_model_col(eti, col)){
- ecell_view = eti->cell_views [col];
+ flags = E_CELL_EDITING | E_CELL_CURSOR;
+ }
- /*
- * Adjust the event positions
- */
- e->motion.x = x1;
- e->motion.y = y1;
+ ecell_view = eti->cell_views [col];
- return_val = eti_e_cell_event (eti, ecell_view, e, e->motion.time,
- view_to_model_col(eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR);
- }
+ /*
+ * Adjust the event positions
+ */
+ e->motion.x = x1;
+ e->motion.y = y1;
+
+ return_val = eti_e_cell_event (eti, ecell_view, e, e->motion.time,
+ view_to_model_col(eti, col), col, row, flags);
break;
}
@@ -2782,6 +2800,14 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
if (eti->tooltip->timer)
gtk_timeout_remove (eti->tooltip->timer);
eti->tooltip->timer = 0;
+ if (eti->motion_row != -1 && eti->motion_col != -1)
+ return_val = eti_e_cell_event (eti, eti->cell_views [eti->motion_col],
+ e, e->crossing.time,
+ view_to_model_col(eti, eti->motion_col),
+ eti->motion_col, eti->motion_row, 0);
+ eti->motion_row = -1;
+ eti->motion_col = -1;
+
break;
case GDK_FOCUS_CHANGE: