evolution r35429 - trunk/mail



Author: mcrha
Date: Mon Apr 28 13:16:48 2008
New Revision: 35429
URL: http://svn.gnome.org/viewvc/evolution?rev=35429&view=rev

Log:
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.



Modified:
   trunk/mail/ChangeLog
   trunk/mail/em-format-html-display.c
   trunk/mail/em-format-html.c
   trunk/mail/em-format-html.h

Modified: trunk/mail/em-format-html-display.c
==============================================================================
--- trunk/mail/em-format-html-display.c	(original)
+++ trunk/mail/em-format-html-display.c	Mon Apr 28 13:16:48 2008
@@ -241,27 +241,22 @@
 	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;
-
-		DARKER (r, 18);
-		DARKER (g, 18);
-		DARKER (b, 18);
+		r = style->fg[state].red >> 8;
+		g = style->fg[state].green >> 8;
+		b = style->fg[state].blue >> 8;		
+
+		efhd->formathtml.header_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;		
 
 		efhd->formathtml.body_colour = ((r<<16) | (g<< 8) | b) & 0xffffff;
 
-		/* 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;
-
-		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;
 

Modified: trunk/mail/em-format-html.c
==============================================================================
--- trunk/mail/em-format-html.c	(original)
+++ trunk/mail/em-format-html.c	Mon Apr 28 13:16:48 2008
@@ -163,6 +163,7 @@
 	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 @@
 		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 @@
 	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 @@
 	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 @@
 
 	/* 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 @@
 			    "<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 @@
 		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;
 	

Modified: trunk/mail/em-format-html.h
==============================================================================
--- trunk/mail/em-format-html.h	(original)
+++ trunk/mail/em-format-html.h	Mon Apr 28 13:16:48 2008
@@ -153,6 +153,7 @@
  * @headers:
  * @text_html_flags:
  * @body_colour:
+ * @header_colour:
  * @text_colour:
  * @frame_colour:
  * @content_colour:
@@ -183,6 +184,7 @@
 
 	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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]