From cbe504718b4f65fd35ac4ae5780728862f7b6e88 Mon Sep 17 00:00:00 2001 From: Rodney Dawes Date: Thu, 20 May 2004 20:13:12 +0000 Subject: Use the activate signal, instead of changed, for the combo box 2004-05-20 Rodney Dawes * e-timezone-dialog/e-timezone-dialog.c (e_timezone_dialog_construct): Use the activate signal, instead of changed, for the combo box (on_map_motion): Set the text in the combo's entry when we mouse over one of the points on the map, as a preview for the timezone (on_map_leave): Reset the combo's entry to the timezone we started with when we leave the map Fixes #57122 svn path=/trunk/; revision=26020 --- widgets/ChangeLog | 11 +++++++++++ widgets/e-timezone-dialog/e-timezone-dialog.c | 11 ++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'widgets') diff --git a/widgets/ChangeLog b/widgets/ChangeLog index 765112025a..e1674cc07f 100644 --- a/widgets/ChangeLog +++ b/widgets/ChangeLog @@ -1,3 +1,14 @@ +2004-05-20 Rodney Dawes + + * e-timezone-dialog/e-timezone-dialog.c (e_timezone_dialog_construct): + Use the activate signal, instead of changed, for the combo box + (on_map_motion): Set the text in the combo's entry when we mouse over + one of the points on the map, as a preview for the timezone + (on_map_leave): Reset the combo's entry to the timezone we started with + when we leave the map + + Fixes #57122 + 2004-04-09 Rodney Dawes * e-timezone-dialog/e-timezone-dialog.c diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.c b/widgets/e-timezone-dialog/e-timezone-dialog.c index d586fc8a76..088ceaf26f 100644 --- a/widgets/e-timezone-dialog/e-timezone-dialog.c +++ b/widgets/e-timezone-dialog/e-timezone-dialog.c @@ -269,7 +269,7 @@ e_timezone_dialog_construct (ETimezoneDialog *etd) g_signal_connect (map, "visibility-notify-event", G_CALLBACK (on_map_visibility_changed), etd); g_signal_connect (map, "button-press-event", G_CALLBACK (on_map_button_pressed), etd); - g_signal_connect (GTK_COMBO (priv->timezone_combo)->entry, "changed", G_CALLBACK (on_combo_changed), etd); + g_signal_connect (GTK_COMBO (priv->timezone_combo)->entry, "activate", G_CALLBACK (on_combo_changed), etd); return etd; @@ -366,6 +366,7 @@ on_map_motion (GtkWidget *widget, GdkEventMotion *event, gpointer data) ETimezoneDialog *etd; ETimezoneDialogPrivate *priv; double longitude, latitude; + icaltimezone *new_zone; etd = E_TIMEZONE_DIALOG (data); priv = etd->priv; @@ -384,6 +385,11 @@ on_map_motion (GtkWidget *widget, GdkEventMotion *event, gpointer data) e_map_point_set_color_rgba (priv->map, priv->point_hover, E_TIMEZONE_DIALOG_MAP_POINT_HOVER_RGBA); + new_zone = get_zone_from_point (etd, priv->point_hover); + + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->timezone_combo)->entry), + zone_display_name (new_zone)); + return TRUE; } @@ -407,6 +413,9 @@ on_map_leave (GtkWidget *widget, GdkEventCrossing *event, gpointer data) e_map_point_set_color_rgba (priv->map, priv->point_hover, E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); + gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->timezone_combo)->entry), + zone_display_name (priv->zone)); + priv->point_hover = NULL; return FALSE; -- cgit v1.2.3