diff options
author | Milan Crha <mcrha@redhat.com> | 2008-06-19 00:43:02 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-06-19 00:43:02 +0800 |
commit | 058584357ec854d2c09663c65cf7760904ab4696 (patch) | |
tree | 9e19081214015b616447774ec02cfadfc3f7db4e /mail/em-format-html.c | |
parent | ef395aea81c8fc6b1e2d51c75833e167fdf6510b (diff) | |
download | gsoc2013-evolution-058584357ec854d2c09663c65cf7760904ab4696.tar.gz gsoc2013-evolution-058584357ec854d2c09663c65cf7760904ab4696.tar.zst gsoc2013-evolution-058584357ec854d2c09663c65cf7760904ab4696.zip |
** Fix for bug #423395
2008-06-18 Milan Crha <mcrha@redhat.com>
** Fix for bug #423395
* configure.in: Requires newer GtkHTML, 3.23.5.
* mail/em-format-html.c: (efh_init), (efh_text_plain), (efh_text_enriched),
(efh_text_html), (efh_message_deliverystatus): Put the anchor where
the message body begins and let GtkHTML know the anchor name to place
the cursor there in caret mode on the first focus.
svn path=/trunk/; revision=35650
Diffstat (limited to 'mail/em-format-html.c')
-rw-r--r-- | mail/em-format-html.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mail/em-format-html.c b/mail/em-format-html.c index c43ca1aa46..004c787458 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -85,6 +85,8 @@ #define d(x) #define EFH_TABLE_OPEN "<table>" +#define EFM_MESSAGE_START_ANAME "evolution#message#start" +#define EFH_MESSAGE_START "<A name=\"" EFM_MESSAGE_START_ANAME "\"></A>" struct _EMFormatHTMLCache { CamelMultipart *textmp; @@ -153,6 +155,7 @@ efh_init(GObject *o) efh->html = (GtkHTML *)gtk_html_new(); gtk_html_set_blocking(efh->html, FALSE); + gtk_html_set_caret_first_focus_anchor (efh->html, EFM_MESSAGE_START_ANAME); g_object_ref_sink(efh->html); gtk_html_set_default_content_type(efh->html, "text/html; charset=utf-8"); @@ -799,7 +802,7 @@ efh_text_plain(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFo camel_stream_printf (stream, "<div style=\"border: solid #%06x 1px; background-color: #%06x; padding: 10px; color: #%06x;\">\n", efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff, efh->text_colour & 0xffffff); - camel_stream_write_string(stream, "<tt>\n"); + camel_stream_write_string(stream, "<tt>\n" EFH_MESSAGE_START); em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, (CamelDataWrapper *)newpart); camel_stream_flush((CamelStream *)filtered_stream); camel_stream_write_string(stream, "</tt>\n"); @@ -837,7 +840,7 @@ efh_text_enriched(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, E camel_object_unref(enriched); camel_stream_printf (stream, - "<div style=\"border: solid #%06x 1px; background-color: #%06x; padding: 10px; color: #%06x;\">\n", + "<div style=\"border: solid #%06x 1px; background-color: #%06x; padding: 10px; color: #%06x;\">\n" EFH_MESSAGE_START, efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff, efh->text_colour & 0xffffff); em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, (CamelDataWrapper *)part); @@ -875,7 +878,7 @@ efh_text_html(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFor camel_stream_printf (stream, "<div style=\"border: solid #%06x 1px; background-color: #%06x; color: #%06x;\">\n" - "<!-- text/html -->\n", + "<!-- text/html -->\n" EFH_MESSAGE_START, efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff, efh->text_colour & 0xffffff); /* TODO: perhaps we don't need to calculate this anymore now base is handled better */ @@ -1022,7 +1025,7 @@ efh_message_deliverystatus(EMFormatHTML *efh, CamelStream *stream, CamelMimePart camel_stream_filter_add(filtered_stream, html_filter); camel_object_unref(html_filter); - camel_stream_write_string(stream, "<tt>\n"); + camel_stream_write_string(stream, "<tt>\n" EFH_MESSAGE_START); em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, (CamelDataWrapper *)part); camel_stream_flush((CamelStream *)filtered_stream); camel_stream_write_string(stream, "</tt>\n"); |