From 2e6ea617fa702f5056cc15255a9b4fb52ca0458f Mon Sep 17 00:00:00 2001 From: Johan Euphrosine Date: Mon, 28 Apr 2008 13:16:48 +0000 Subject: ** Fix for bug #529247 2008-04-28 Johan Euphrosine ** 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 --- mail/em-format-html-display.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'mail/em-format-html-display.c') 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; -- cgit