From 0120f7fffdc41671d78c5bc65c33a24074ffdbc9 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Thu, 12 May 2005 05:42:18 +0000 Subject: Fix the bug 303856. Enables OK button when arrow key used to change the 2005-05-12 Srinivasa Ragavan * misc/e-dateedit.c: (on_time_entry_key_release), (create_children): Fix the bug 303856. Enables OK button when arrow key used to change the time in a appointment. svn path=/trunk/; revision=29329 --- widgets/misc/e-dateedit.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'widgets/misc') diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index 58962c2cb7..b27d1778c6 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -181,6 +181,9 @@ static void on_date_edit_time_selected (GtkList *list, static gint on_time_entry_key_press (GtkWidget *widget, GdkEventKey *event, EDateEdit *dedit); +static gint on_time_entry_key_release (GtkWidget *widget, + GdkEventKey *event, + EDateEdit *dedit); static gint on_date_entry_focus_out (GtkEntry *entry, GdkEventFocus *event, EDateEdit *dedit); @@ -375,6 +378,10 @@ create_children (EDateEdit *dedit) "key_press_event", G_CALLBACK (on_time_entry_key_press), dedit); + g_signal_connect (GTK_COMBO (priv->time_combo)->entry, + "key_release_event", + G_CALLBACK (on_time_entry_key_release), + dedit); g_signal_connect_after (GTK_COMBO (priv->time_combo)->entry, "focus_out_event", G_CALLBACK (on_time_entry_focus_out), @@ -1577,6 +1584,21 @@ on_time_entry_key_press (GtkWidget *widget, return FALSE; } +static gint +on_time_entry_key_release (GtkWidget *widget, + GdkEventKey *event, + EDateEdit *dedit) +{ + if (event->keyval == GDK_Up || event->keyval == GDK_Down) { + g_signal_stop_emission_by_name (widget, + "key_release_event"); + e_date_edit_check_time_changed (dedit); + return TRUE; + } + + return FALSE; +} + static gint on_date_entry_focus_out (GtkEntry *entry, -- cgit