aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/e-table/e-cell-tree.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@helixcode.com>2000-06-11 12:44:27 +0800
committerChris Toshok <toshok@src.gnome.org>2000-06-11 12:44:27 +0800
commit07707b81afe216c617fead536a69b98d638f0e19 (patch)
tree72bd1378842b87a27ecbddb9478714d9b7c84e2c /widgets/e-table/e-cell-tree.c
parentaac3f2c8b69f579e04314b21a13d752afe4bd317 (diff)
downloadgsoc2013-evolution-07707b81afe216c617fead536a69b98d638f0e19.tar
gsoc2013-evolution-07707b81afe216c617fead536a69b98d638f0e19.tar.gz
gsoc2013-evolution-07707b81afe216c617fead536a69b98d638f0e19.tar.bz2
gsoc2013-evolution-07707b81afe216c617fead536a69b98d638f0e19.tar.lz
gsoc2013-evolution-07707b81afe216c617fead536a69b98d638f0e19.tar.xz
gsoc2013-evolution-07707b81afe216c617fead536a69b98d638f0e19.tar.zst
gsoc2013-evolution-07707b81afe216c617fead536a69b98d638f0e19.zip
offset events before passing them to our subcell view.
2000-06-10 Chris Toshok <toshok@helixcode.com> * e-cell-tree.c (ect_event): offset events before passing them to our subcell view. svn path=/trunk/; revision=3520
Diffstat (limited to 'widgets/e-table/e-cell-tree.c')
-rw-r--r--widgets/e-table/e-cell-tree.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/widgets/e-table/e-cell-tree.c b/widgets/e-table/e-cell-tree.c
index c3459ce4f8..893cae4f4c 100644
--- a/widgets/e-table/e-cell-tree.c
+++ b/widgets/e-table/e-cell-tree.c
@@ -282,14 +282,14 @@ static gint
ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row)
{
ECellTreeView *tree_view = (ECellTreeView *) ecell_view;
+ ETreeModel *tree_model = e_cell_tree_get_tree_model (ecell_view->e_table_model, row);
+ ETreePath *node = e_cell_tree_get_node (tree_model, row);
+ int offset = offset_of_node (tree_model, node);
switch (event->type) {
case GDK_BUTTON_PRESS: {
/* if the event happened in our area of control (and
we care about it), handle it. */
- ETreeModel *tree_model = e_cell_tree_get_tree_model (ecell_view->e_table_model, row);
- ETreePath *node = e_cell_tree_get_node (tree_model, row);
- int offset = offset_of_node (tree_model, node);
/* only activate the tree control if the click/release happens in the icon's area. */
if (event->button.x > (offset - INDENT_AMOUNT) && event->button.x < offset) {
@@ -304,7 +304,20 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col,
return TRUE;
}
default:
- /* otherwise, pass it off to our subcell_view */
+ /* 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 */
+ }
e_cell_event(tree_view->subcell_view, event, model_col, view_col, row);
return TRUE;
}