aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-10-31 06:09:46 +0800
committerChris Lahey <clahey@src.gnome.org>2001-10-31 06:09:46 +0800
commit02ffaef8e15338007818af8687433527a37517e3 (patch)
tree557617c37ade91788325e96dd3f293f3a7e52315 /widgets
parent32ce65319d3b7ce18f84a99080031072a6451138 (diff)
downloadgsoc2013-evolution-02ffaef8e15338007818af8687433527a37517e3.tar.gz
gsoc2013-evolution-02ffaef8e15338007818af8687433527a37517e3.tar.zst
gsoc2013-evolution-02ffaef8e15338007818af8687433527a37517e3.zip
Leave edit if commit is called.
2001-10-30 Christopher James Lahey <clahey@ximian.com> * e-table.c (e_table_commit_click_to_add): Leave edit if commit is called. svn path=/trunk/; revision=14487
Diffstat (limited to 'widgets')
-rw-r--r--widgets/table/e-table.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index ad0bc54855..8724e15dd5 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -722,6 +722,19 @@ et_canvas_realize (GtkWidget *canvas, ETable *e_table)
NULL);
}
+static void
+et_eti_leave_edit (ETable *et)
+{
+ GnomeCanvas *canvas = et->table_canvas;
+ 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));
+ }
+ }
+}
+
static gint
et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETable *e_table)
{
@@ -730,14 +743,8 @@ et_canvas_root_event (GnomeCanvasItem *root, GdkEvent *event, ETable *e_table)
case GDK_2BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
if (event->button.button != 4 && event->button.button != 5) {
- 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;
- }
- }
+ et_eti_leave_edit (e_table);
+ return TRUE;
}
break;
default:
@@ -1503,6 +1510,7 @@ e_table_right_click_up (ETable *table)
void
e_table_commit_click_to_add (ETable *table)
{
+ et_eti_leave_edit (table);
if (table->click_to_add)
e_table_click_to_add_commit(E_TABLE_CLICK_TO_ADD(table->click_to_add));
}