diff options
author | Radek Doulik <rodo@src.gnome.org> | 2001-03-23 04:37:34 +0800 |
---|---|---|
committer | Radek Doulik <rodo@src.gnome.org> | 2001-03-23 04:37:34 +0800 |
commit | f03258745ee3a0f97c1f06df2b92830d7f09110a (patch) | |
tree | b63a00ef7c5e937233a5d0e87d8f58c2791a3d84 /mail | |
parent | 43e4eda38afa43af484dcf7b5929081fa8c3025f (diff) | |
download | gsoc2013-evolution-f03258745ee3a0f97c1f06df2b92830d7f09110a.tar gsoc2013-evolution-f03258745ee3a0f97c1f06df2b92830d7f09110a.tar.gz gsoc2013-evolution-f03258745ee3a0f97c1f06df2b92830d7f09110a.tar.bz2 gsoc2013-evolution-f03258745ee3a0f97c1f06df2b92830d7f09110a.tar.lz gsoc2013-evolution-f03258745ee3a0f97c1f06df2b92830d7f09110a.tar.xz gsoc2013-evolution-f03258745ee3a0f97c1f06df2b92830d7f09110a.tar.zst gsoc2013-evolution-f03258745ee3a0f97c1f06df2b92830d7f09110a.zip |
(html_enter_notify_event): take care of enter event
(update_active): helper function, extracted from
html_motion_notify_event
svn path=/trunk/; revision=8902
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 3 | ||||
-rw-r--r-- | mail/mail-display.c | 47 |
2 files changed, 37 insertions, 13 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 60e8c0be89..a41ef4bf87 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -11,6 +11,9 @@ implemented (html_motion_notify_event): new handler, highlights addresses by underline + (html_enter_notify_event): take care of enter event + (update_active): helper function, extracted from + html_motion_notify_event * mail-format.c (write_address): revert back to raw HTML text, store name and email to Text objects, workaround gtkhtml tables diff --git a/mail/mail-display.c b/mail/mail-display.c index 9ee45bac9c..5db433513a 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -1134,23 +1134,13 @@ set_underline (HTMLEngine *e, HTMLObject *o, gboolean underline) html_engine_queue_draw (e, o); } -static gint -html_motion_notify_event (GtkWidget *widget, GdkEventMotion *event, MailDisplay *mail_display) +static void +update_active (GtkWidget *widget, gint x, gint y, MailDisplay *mail_display) { HTMLPoint *point; const gchar *email; - gint x, y; - g_return_val_if_fail (widget != NULL, 0); - g_return_val_if_fail (GTK_IS_HTML (widget), 0); - g_return_val_if_fail (event != NULL, 0); - - if (!event->is_hint) { - x = event->x; - y = event->y; - } - - point = html_engine_get_point_at (GTK_HTML (widget)->engine, event->x, event->y, FALSE); + point = html_engine_get_point_at (GTK_HTML (widget)->engine, x, y, FALSE); if (mail_display->last_active && (!point || mail_display->last_active != point->object)) { set_underline (GTK_HTML (widget)->engine, HTML_OBJECT (mail_display->last_active), FALSE); mail_display->last_active = NULL; @@ -1163,6 +1153,33 @@ html_motion_notify_event (GtkWidget *widget, GdkEventMotion *event, MailDisplay } html_point_destroy (point); } +} + +static gint +html_enter_notify_event (GtkWidget *widget, GdkEventCrossing *event, MailDisplay *mail_display) +{ + update_active (widget, event->x, event->y, mail_display); + + return TRUE; +} + +static gint +html_motion_notify_event (GtkWidget *widget, GdkEventMotion *event, MailDisplay *mail_display) +{ + gint x, y; + + g_return_val_if_fail (widget != NULL, 0); + g_return_val_if_fail (GTK_IS_HTML (widget), 0); + g_return_val_if_fail (event != NULL, 0); + + if (event->is_hint) + gdk_window_get_pointer (GTK_LAYOUT (widget)->bin_window, &x, &y, NULL); + else { + x = event->x; + y = event->y; + } + + update_active (widget, x, y, mail_display); return TRUE; } @@ -1174,6 +1191,8 @@ html_iframe_created (GtkWidget *w, GtkHTML *iframe, MailDisplay *mail_display) GTK_SIGNAL_FUNC (html_button_press_event), mail_display); gtk_signal_connect (GTK_OBJECT (iframe), "motion_notify_event", GTK_SIGNAL_FUNC (html_motion_notify_event), mail_display); + gtk_signal_connect (GTK_OBJECT (iframe), "enter_notify_event", + GTK_SIGNAL_FUNC (html_enter_notify_event), mail_display); } GtkWidget * @@ -1210,6 +1229,8 @@ mail_display_new (void) GTK_SIGNAL_FUNC (html_button_press_event), mail_display); gtk_signal_connect (GTK_OBJECT (html), "motion_notify_event", GTK_SIGNAL_FUNC (html_motion_notify_event), mail_display); + gtk_signal_connect (GTK_OBJECT (html), "enter_notify_event", + GTK_SIGNAL_FUNC (html_enter_notify_event), mail_display); gtk_signal_connect (GTK_OBJECT (html), "iframe_created", GTK_SIGNAL_FUNC (html_iframe_created), mail_display); |