diff options
author | Johan Euphrosine <proppy@aminche.com> | 2008-04-28 21:16:48 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-04-28 21:16:48 +0800 |
commit | 2e6ea617fa702f5056cc15255a9b4fb52ca0458f (patch) | |
tree | e1531a1de3ecc650ee64165534a99951cdf83249 /mail | |
parent | 582233e1de6f3df345f7db437fdbce035e142b13 (diff) | |
download | gsoc2013-evolution-2e6ea617fa702f5056cc15255a9b4fb52ca0458f.tar gsoc2013-evolution-2e6ea617fa702f5056cc15255a9b4fb52ca0458f.tar.gz gsoc2013-evolution-2e6ea617fa702f5056cc15255a9b4fb52ca0458f.tar.bz2 gsoc2013-evolution-2e6ea617fa702f5056cc15255a9b4fb52ca0458f.tar.lz gsoc2013-evolution-2e6ea617fa702f5056cc15255a9b4fb52ca0458f.tar.xz gsoc2013-evolution-2e6ea617fa702f5056cc15255a9b4fb52ca0458f.tar.zst gsoc2013-evolution-2e6ea617fa702f5056cc15255a9b4fb52ca0458f.zip |
** Fix for bug #529247
2008-04-28 Johan Euphrosine <proppy@aminche.com>
** Fix for bug #529247
* em-format-html.h (struct _EMFormatHTML): Add header_colour.
* em-format-html-display.c (efhd_gtkhtml_realise): Use bg style
properties for body_colour, fg for header_colour, darken for
frame_colour, bg for content_colour.
* em-format-html.c (efh_init), (efh_format_exec), (efh_init),
(efh_text_plain), (efh_text_enriched), (efh_text_html),
(efh_message_deliverystatus): Use header_colour for text color of
the message header, body_colour for background color of the
message header, text_colour for text color of the message content,
base_colour for background color of the message content.
svn path=/trunk/; revision=35429
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 17 | ||||
-rw-r--r-- | mail/em-format-html-display.c | 27 | ||||
-rw-r--r-- | mail/em-format-html.c | 21 | ||||
-rw-r--r-- | mail/em-format-html.h | 2 |
4 files changed, 41 insertions, 26 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 45fc8d1b49..979b36e4bb 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,20 @@ +2008-04-28 Johan Euphrosine <proppy@aminche.com> + + ** Fix for bug #529247 + + * em-format-html.h (struct _EMFormatHTML): Add header_colour. + + * em-format-html-display.c (efhd_gtkhtml_realise): Use bg style + properties for body_colour, fg for header_colour, darken for + frame_colour, bg for content_colour. + + * em-format-html.c (efh_init), (efh_format_exec), (efh_init), + (efh_text_plain), (efh_text_enriched), (efh_text_html), + (efh_message_deliverystatus): Use header_colour for text color of + the message header, body_colour for background color of the + message header, text_colour for text color of the message content, + base_colour for background color of the message content. + 2008-04-28 Srinivasa Ragavan <sragavan@novell.com> * mail/em-utils.c: Avoid crash while detecting mime types. diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index 48b9abc718..4c99d027ff 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -241,27 +241,22 @@ efhd_gtkhtml_realise(GtkHTML *html, EMFormatHTMLDisplay *efhd) if (style) { int state = GTK_WIDGET_STATE(html); gushort r, g, b; -#define DARKER(a,v) a = ((a) > (v)) ? ((a) - (v)) : 0 - /* choose a suitably darker or lighter colour */ - r = style->base[state].red >> 8; - g = style->base[state].green >> 8; - b = style->base[state].blue >> 8; + r = style->fg[state].red >> 8; + g = style->fg[state].green >> 8; + b = style->fg[state].blue >> 8; - DARKER (r, 18); - DARKER (g, 18); - DARKER (b, 18); + efhd->formathtml.header_colour = ((r<<16) | (g<< 8) | b) & 0xffffff; - efhd->formathtml.body_colour = ((r<<16) | (g<< 8) | b) & 0xffffff; + r = style->bg[state].red >> 8; + g = style->bg[state].green >> 8; + b = style->bg[state].blue >> 8; - /* choose a suitably darker or lighter colour */ - r = style->base[state].red >> 8; - g = style->base[state].green >> 8; - b = style->base[state].blue >> 8; + efhd->formathtml.body_colour = ((r<<16) | (g<< 8) | b) & 0xffffff; - DARKER (r, 82); - DARKER (g, 82); - DARKER (b, 82); + r = style->dark[state].red >> 8; + g = style->dark[state].green >> 8; + b = style->dark[state].blue >> 8; efhd->formathtml.frame_colour = ((r<<16) | (g<< 8) | b) & 0xffffff; diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 054301aa2d..8e3878ab3f 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -163,6 +163,7 @@ efh_init(GObject *o) g_signal_connect(efh->html, "object_requested", G_CALLBACK(efh_object_requested), efh); efh->body_colour = 0xeeeeee; + efh->header_colour = 0xeeeeee; efh->text_colour = 0; efh->frame_colour = 0x3f3f3f; efh->content_colour = 0xffffff; @@ -795,8 +796,8 @@ efh_text_plain(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFo type = camel_mime_part_get_content_type(newpart); if (camel_content_type_is (type, "text", "*") && !camel_content_type_is(type, "text", "calendar")) { camel_stream_printf (stream, - "<div style=\"border: solid #%06x 1px; background-color: #%06x; padding: 10px;\">\n", - efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff); + "<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"); em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, (CamelDataWrapper *)newpart); camel_stream_flush((CamelStream *)filtered_stream); @@ -835,8 +836,8 @@ 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;\">\n", - efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff); + "<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); em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, (CamelDataWrapper *)part); @@ -872,9 +873,9 @@ efh_text_html(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFor char *cid = NULL; camel_stream_printf (stream, - "<div style=\"border: solid #%06x 1px; background-color: #%06x;\">\n" + "<div style=\"border: solid #%06x 1px; background-color: #%06x; color: #%06x;\">\n" "<!-- text/html -->\n", - efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff); + 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 */ /* calculate our own location string so add_puri doesn't do it @@ -1012,8 +1013,8 @@ efh_message_deliverystatus(EMFormatHTML *efh, CamelStream *stream, CamelMimePart /* Yuck, this is copied from efh_text_plain */ camel_stream_printf (stream, - "<div style=\"border: solid #%06x 1px; background-color: #%06x; padding: 10px;\">\n", - efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff); + "<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); filtered_stream = camel_stream_filter_new_with_stream(stream); html_filter = camel_mime_filter_tohtml_new(efh->text_html_flags, rgb); @@ -1247,7 +1248,7 @@ efh_format_exec (struct _format_msg *m) "<head>\n<meta name=\"generator\" content=\"Evolution Mail Component\">\n</head>\n" "<body bgcolor =\"#%06x\" text=\"#%06x\" marginwidth=6 marginheight=6>\n", m->format->body_colour & 0xffffff, - m->format->text_colour & 0xffffff); + m->format->header_colour & 0xffffff); /* <insert top-header stuff here> */ @@ -1848,7 +1849,7 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) camel_stream_printf(stream, "<font color=\"#%06x\">\n" "<table cellpadding=\"0\" width=\"100%%\">", - efh->text_colour & 0xffffff); + efh->header_colour & 0xffffff); hdr_charset = emf->charset ? emf->charset : emf->default_charset; diff --git a/mail/em-format-html.h b/mail/em-format-html.h index d0a6655dc3..7c419f3ba7 100644 --- a/mail/em-format-html.h +++ b/mail/em-format-html.h @@ -153,6 +153,7 @@ struct _EMFormatHTMLPObject { * @headers: * @text_html_flags: * @body_colour: + * @header_colour: * @text_colour: * @frame_colour: * @content_colour: @@ -183,6 +184,7 @@ struct _EMFormatHTML { guint32 text_html_flags; /* default flags for text to html conversion */ guint32 body_colour; /* header box colour */ + guint32 header_colour; guint32 text_colour; guint32 frame_colour; guint32 content_colour; |