diff options
author | Not Zed <NotZed@Ximian.com> | 2003-08-06 06:20:51 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2003-08-06 06:20:51 +0800 |
commit | 761541cefb84c7c024d415d0b7a5a85aa72685d7 (patch) | |
tree | 2f8d02aea23806f5038a9dfc1d0c53a56366fda7 /mail | |
parent | 9c6056e60136cd86eaf58e364eae33bac3f7c6db (diff) | |
download | gsoc2013-evolution-761541cefb84c7c024d415d0b7a5a85aa72685d7.tar.gz gsoc2013-evolution-761541cefb84c7c024d415d0b7a5a85aa72685d7.tar.zst gsoc2013-evolution-761541cefb84c7c024d415d0b7a5a85aa72685d7.zip |
** See bug #47224. Hook onto clicked rather than button_pressed, so that
2003-08-05 Not Zed <NotZed@Ximian.com>
** See bug #47224. Hook onto clicked rather than button_pressed,
so that dnd works.
* mail-display.c (inline_toggle): toggle a part inline.
(button_press): change back to only handle button clicked events,
renamed to inline_button_clicked.
(do_attachment_header): hook onto clicked rather than
button_press_event, and move key_press_event to
inline_button_pressed.
(do_signature): Same.
(inline_button_pressed): handle inline button key press event
explicitly.
svn path=/trunk/; revision=22095
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 15 | ||||
-rw-r--r-- | mail/mail-display.c | 39 |
2 files changed, 36 insertions, 18 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 962f8ea39a..6a9eceffdd 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,18 @@ +2003-08-05 Not Zed <NotZed@Ximian.com> + + ** See bug #47224. Hook onto clicked rather than button_pressed, + so that dnd works. + + * mail-display.c (inline_toggle): toggle a part inline. + (button_press): change back to only handle button clicked events, + renamed to inline_button_clicked. + (do_attachment_header): hook onto clicked rather than + button_press_event, and move key_press_event to + inline_button_pressed. + (do_signature): Same. + (inline_button_pressed): handle inline button key press event + explicitly. + 2003-07-29 Not Zed <NotZed@Ximian.com> * mail-folder-cache.c (mail_note_store): add a CamelOperation for diff --git a/mail/mail-display.c b/mail/mail-display.c index e811b29e41..9654d9b198 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -536,25 +536,28 @@ save_all_cb (GtkWidget *widget, gpointer user_data) save_all_parts (attachment_array); } +static void +inline_toggle(MailDisplay *md, CamelMimePart *part) +{ + g_return_if_fail(md != NULL); + + mail_part_toggle_displayed (part, md); + mail_display_queue_redisplay (md); +} -static gboolean -button_press (GtkWidget *widget, GdkEvent *event, CamelMimePart *part) +static void +inline_button_clicked(GtkWidget *widget, CamelMimePart *part) { - MailDisplay *md; + inline_toggle((MailDisplay *)g_object_get_data((GObject *)widget, "MailDisplay"), part); +} - if (event->type == GDK_BUTTON_PRESS) - g_signal_stop_emission_by_name (widget, "button_press_event"); - else if (event->type == GDK_KEY_PRESS && event->key.keyval != GDK_Return) +static gboolean +inline_button_press(GtkWidget *widget, GdkEventKey *event, CamelMimePart *part) +{ + if (event->keyval != GDK_Return) return FALSE; - md = g_object_get_data ((GObject *) widget, "MailDisplay"); - if (md == NULL) { - g_warning ("No MailDisplay on button!"); - return TRUE; - } - - mail_part_toggle_displayed (part, md); - mail_display_queue_redisplay (md); + inline_toggle((MailDisplay *)g_object_get_data((GObject *)widget, "MailDisplay"), part); return TRUE; } @@ -1138,8 +1141,8 @@ do_attachment_header (GtkHTML *html, GtkHTMLEmbedded *eb, handler = mail_lookup_handler (eb->type); if (handler && handler->builtin) { - g_signal_connect (button, "button_press_event", G_CALLBACK (button_press), part); - g_signal_connect (button, "key_press_event", G_CALLBACK (button_press), part); + g_signal_connect (button, "clicked", G_CALLBACK (inline_button_clicked), part); + g_signal_connect (button, "key_press_event", G_CALLBACK (inline_button_press), part); } else { gtk_widget_set_sensitive (button, FALSE); GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS); @@ -1289,8 +1292,8 @@ do_signature (GtkHTML *html, GtkHTMLEmbedded *eb, button = gtk_button_new (); g_object_set_data ((GObject *) button, "MailDisplay", md); - g_signal_connect (button, "button_press_event", G_CALLBACK (button_press), part); - g_signal_connect (button, "key_press_event", G_CALLBACK (button_press), part); + g_signal_connect (button, "clicked", G_CALLBACK (inline_button_clicked), part); + g_signal_connect (button, "key_press_event", G_CALLBACK (inline_button_press), part); gtk_container_add (GTK_CONTAINER (button), pbl->pixmap); gtk_widget_show_all (button); |