[evolution-patches] Please review my patch for bug #48290
- From: Antonio Xu <antonio xu sun com>
- To: evolution-patches <evolution-patches lists ximian com>
- Subject: [evolution-patches] Please review my patch for bug #48290
- Date: Tue, 09 Sep 2003 22:14:52 +0800
Hello All,
Could you review my patch for bug #48290?
My patch will set the default text color before gtkhtml create object
tree for printing preview, then gtkhtml will use the color to create
text object, rather then using the default text color of gtk style.
Bug summary:
Selecting inverse theme causes text to be printed white-on-white
Bug link:
http://bugzilla.ximian.com/show_bug.cgi?id=48290
Thanks
Antonio Xu
Index: mail/mail-display.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-display.c,v
retrieving revision 1.282.4.6
diff -u -r1.282.4.6 mail-display.c
--- mail/mail-display.c 28 Aug 2003 18:20:10 -0000 1.282.4.6
+++ mail/mail-display.c 9 Sep 2003 12:45:14 -0000
@@ -1796,11 +1796,12 @@
"<head>\n<meta name=\"generator\" content=\"Evolution Mail Component\">\n</head>\n"
void
-mail_display_render (MailDisplay *md, GtkHTML *html, gboolean reset_scroll)
+mail_display_render (MailDisplay *md, GtkHTML *html, gboolean reset_scroll, gboolean is_print)
{
const char *flag, *completed;
GtkHTMLStream *html_stream;
MailDisplayStream *stream;
+ char *body;
g_return_if_fail (IS_MAIL_DISPLAY (md));
g_return_if_fail (GTK_IS_HTML (html));
@@ -1819,10 +1820,14 @@
gtk_html_stream_write (html_stream, HTML_HEADER, sizeof (HTML_HEADER) - 1);
if (md->current_message && md->display_style == MAIL_CONFIG_DISPLAY_SOURCE)
- gtk_html_stream_write (html_stream, "<body>\n", 7);
+ body = g_strdup_printf("%s%s%s", "<body",
+ is_print ? " text=\"#000000\"" : "", ">\n");
else
- gtk_html_stream_write (html_stream, "<body marginwidth=0 marginheight=0>\n", 36);
+ body = g_strdup_printf("%s%s%s", "<body marginwidth=0 marginheight=0",
+ is_print ? " text=\"#000000\"" : "", ">\n");
+ gtk_html_stream_write (html_stream, body, strlen(body));
+ g_free(body);
flag = md->info ? camel_tag_get (&md->info->user_tags, "follow-up") : NULL;
completed = md->info ? camel_tag_get (&md->info->user_tags, "completed-on") : NULL;
if ((flag && *flag) && !(completed && *completed)) {
@@ -1934,7 +1939,7 @@
md->redisplay_counter++;
/* printf ("md %p redisplay %d\n", md, md->redisplay_counter); */
- mail_display_render (md, md->html, reset_scroll);
+ mail_display_render (md, md->html, reset_scroll, FALSE);
}
Index: mail/mail-display.h
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-display.h,v
retrieving revision 1.48
diff -u -r1.48 mail-display.h
--- mail/mail-display.h 11 Feb 2003 20:45:27 -0000 1.48
+++ mail/mail-display.h 9 Sep 2003 12:45:25 -0000
@@ -92,7 +92,8 @@
void mail_display_initialize_gtkhtml (MailDisplay *mail_display, GtkHTML *html);
void mail_display_queue_redisplay (MailDisplay *mail_display);
-void mail_display_render (MailDisplay *mail_display, GtkHTML *html, gboolean reset_scroll);
+void mail_display_render (MailDisplay *mail_display,GtkHTML *html,
+ gboolean reset_scroll, gboolean is_print);
void mail_display_redisplay (MailDisplay *mail_display, gboolean reset_scroll);
void mail_display_redisplay_when_loaded (MailDisplay *md,
gconstpointer key,
Index: mail/mail-callbacks.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-callbacks.c,v
retrieving revision 1.447.2.2
diff -u -r1.447.2.2 mail-callbacks.c
--- mail/mail-callbacks.c 22 Aug 2003 16:45:16 -0000 1.447.2.2
+++ mail/mail-callbacks.c 9 Sep 2003 12:45:54 -0000
@@ -2928,7 +2928,7 @@
gtk_container_add (GTK_CONTAINER (w), GTK_WIDGET (html));
gtk_widget_realize (GTK_WIDGET (html));
}
- mail_display_render (fb->mail_display, html, TRUE);
+ mail_display_render (fb->mail_display, html, TRUE, TRUE);
gtk_html_print_set_master (html, print_master);
info = footer_info_new (html, print_context, &line);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]