diff options
Diffstat (limited to 'widgets/e-table')
-rw-r--r-- | widgets/e-table/ChangeLog | 5 | ||||
-rw-r--r-- | widgets/e-table/e-cell-tree.c | 21 |
2 files changed, 22 insertions, 4 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog index b2dc58456d..f99d011b05 100644 --- a/widgets/e-table/ChangeLog +++ b/widgets/e-table/ChangeLog @@ -1,5 +1,10 @@ 2000-06-10 Chris Toshok <toshok@helixcode.com> + * e-cell-tree.c (ect_event): offset events before passing them to + our subcell view. + +2000-06-10 Chris Toshok <toshok@helixcode.com> + * e-table-item.c (eti_event): change things so we focus the cell and select the row, and also dispatch the event to that row/cell. This fixes the problem with the tree where you had to click twice 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; } |