aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/e-minicard-label.c
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/gui/widgets/e-minicard-label.c')
-rw-r--r--addressbook/gui/widgets/e-minicard-label.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c
index 54779c4ea6..b59ff46ae3 100644
--- a/addressbook/gui/widgets/e-minicard-label.c
+++ b/addressbook/gui/widgets/e-minicard-label.c
@@ -20,13 +20,16 @@
*/
#include <config.h>
+
+#include "e-minicard-label.h"
+
#include <gtk/gtksignal.h>
#include <libgnomeui/gnome-canvas-rect-ellipse.h>
#include <gal/util/e-util.h>
#include <gal/e-text/e-text.h>
#include <gal/widgets/e-canvas.h>
#include <gal/widgets/e-canvas-utils.h>
-#include "e-minicard-label.h"
+#include <gdk/gdkkeysyms.h>
static void e_minicard_label_init (EMinicardLabel *card);
static void e_minicard_label_class_init (EMinicardLabelClass *klass);
@@ -300,6 +303,17 @@ e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event)
switch( event->type )
{
+ case GDK_KEY_PRESS:
+ if (event->key.keyval == GDK_Escape) {
+ GnomeCanvasItem *parent;
+
+ e_text_cancel_editing (E_TEXT (e_minicard_label->field));
+
+ parent = GNOME_CANVAS_ITEM (e_minicard_label)->parent;
+ if (parent)
+ e_canvas_item_grab_focus(parent, FALSE);
+ }
+ break;
case GDK_FOCUS_CHANGE:
{
GdkEventFocus *focus_event = (GdkEventFocus *) event;