remove the silly logic - we pop up a tooltip regardless of where the mouse

2000-12-13  Chris Toshok  <toshok@helixcode.com>

	* e-cell-tree.c (ect_show_tooltip): remove the silly logic - we
	pop up a tooltip regardless of where the mouse cursor hovers.
	just make sure it appears in the right place.
	(ect_event): reverse the change we make to the event after passing
	it to our subcell.  this fixes the problem of the tree reacting
	twice to events (once with flags == 0, and once with flags ==
	E_CELL_EDITING).

	* e-table-item.c (eti_event): destroy the tooltip window on a
	motion event.  this can (and does) happen when we get a tooltip on
	a tree cell and the cursor isn't over the area where the tooltip
	pops up.

svn path=/trunk/; revision=6979
This commit is contained in:
Chris Toshok
2000-12-13 23:32:24 +00:00
committed by Chris Toshok
parent a000f7480b
commit 565e65690d
2 changed files with 30 additions and 7 deletions

View File

@ -324,7 +324,9 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col,
else if (event->button.x < (offset - INDENT_AMOUNT))
return FALSE;
}
default:
default: {
gint return_value;
/* modify the event and pass it off to our subcell_view */
switch (event->type) {
case GDK_BUTTON_PRESS:
@ -339,7 +341,26 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col,
default:
/* nada */
}
return e_cell_event(tree_view->subcell_view, event, model_col, view_col, row, flags, actions);
return_value = e_cell_event(tree_view->subcell_view, event, model_col, view_col, row, flags, actions);
/* modify the event and pass it off to our subcell_view */
switch (event->type) {
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
case GDK_2BUTTON_PRESS:
case GDK_3BUTTON_PRESS:
event->button.x += offset;
break;
case GDK_MOTION_NOTIFY:
event->motion.x += offset;
break;
default:
/* nada */
}
return return_value;
}
}
}
@ -429,11 +450,8 @@ ect_show_tooltip (ECellView *ecell_view, int model_col, int view_col, int row,
if (node_image)
offset += gdk_pixbuf_get_width (node_image);
/* if the tooltip happened in the subcell, then handle it */
if (tooltip->cx > offset) {
tooltip->x += offset;
e_cell_show_tooltip (tree_view->subcell_view, model_col, view_col, row, col_width - offset, tooltip);
}
tooltip->x += offset;
e_cell_show_tooltip (tree_view->subcell_view, model_col, view_col, row, col_width - offset, tooltip);
}
/*

View File

@ -1697,6 +1697,11 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
"cursor_col", &cursor_col,
NULL);
if (eti->tooltip->window) {
gtk_widget_destroy (eti->tooltip->window);
eti->tooltip->window = NULL;
}
if (eti->tooltip->timer > 0)
gtk_timeout_remove (eti->tooltip->timer);
eti->tooltip->col = col;