diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-10-26 17:00:36 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-10-26 17:00:36 +0800 |
commit | ec99a182715d6c2efe1167adde2a2b4120a5b8b7 (patch) | |
tree | 94c1a73052b79b62a43680f01690d53de2832ee2 /widgets/table/e-tree.c | |
parent | 464c50e4d7ed2099c1929cfb184187a1c623197d (diff) | |
download | gsoc2013-evolution-ec99a182715d6c2efe1167adde2a2b4120a5b8b7.tar.gz gsoc2013-evolution-ec99a182715d6c2efe1167adde2a2b4120a5b8b7.tar.zst gsoc2013-evolution-ec99a182715d6c2efe1167adde2a2b4120a5b8b7.zip |
If the root node is hidden and selected, don't count it in the selected
2001-10-26 Christopher James Lahey <clahey@ximian.com>
* e-tree-selection-model.c (etsm_selected_count): If the root node
is hidden and selected, don't count it in the selected path count.
* e-tree.c (et_canvas_root_event): Attach to the event handler on
the root canvas item instead of the canvas itself when making the
ETree leave editing state.
svn path=/trunk/; revision=14128
Diffstat (limited to 'widgets/table/e-tree.c')
-rw-r--r-- | widgets/table/e-tree.c | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 6bbf20f16c..edd2a960eb 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -45,6 +45,14 @@ static GtkObjectClass *parent_class; +#define d(x) + +#if d(!)0 +#define e_table_item_leave_edit_(x) (e_table_item_leave_edit((x)), g_print ("%s: e_table_item_leave_edit\n", __FUNCTION__)) +#else +#define e_table_item_leave_edit_(x) (e_table_item_leave_edit((x))) +#endif + enum { CURSOR_CHANGE, CURSOR_ACTIVATED, @@ -685,14 +693,23 @@ et_canvas_realize (GtkWidget *canvas, ETree *e_tree) } static gint -et_canvas_button_press (GtkWidget *canvas, GdkEventButton *event, ETree *e_tree) -{ - if (GTK_WIDGET_HAS_FOCUS(canvas)) { - GnomeCanvasItem *item = GNOME_CANVAS(canvas)->focused_item; - - if (E_IS_TABLE_ITEM(item)) { - e_table_item_leave_edit(E_TABLE_ITEM(item)); +et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETree *e_tree) +{ + switch (event->type) { + case GDK_BUTTON_PRESS: + case GDK_2BUTTON_PRESS: + case GDK_BUTTON_RELEASE: + if (GTK_WIDGET_HAS_FOCUS(root->canvas)) { + GnomeCanvasItem *item = GNOME_CANVAS(root->canvas)->focused_item; + + if (E_IS_TABLE_ITEM(item)) { + e_table_item_leave_edit_(E_TABLE_ITEM(item)); + return TRUE; + } } + break; + default: + break; } return FALSE; @@ -781,8 +798,8 @@ e_tree_setup_table (ETree *e_tree) GTK_OBJECT(e_tree->priv->table_canvas), "realize", GTK_SIGNAL_FUNC(et_canvas_realize), e_tree); gtk_signal_connect ( - GTK_OBJECT(e_tree->priv->table_canvas), "button_press_event", - GTK_SIGNAL_FUNC(et_canvas_button_press), e_tree); + GTK_OBJECT(gnome_canvas_root (e_tree->priv->table_canvas)), "event", + GTK_SIGNAL_FUNC(et_canvas_root_event), e_tree); et_build_item(e_tree); } |