diff options
-rw-r--r-- | mail/ChangeLog | 19 | ||||
-rw-r--r-- | mail/mail-accounts.c | 2 | ||||
-rw-r--r-- | mail/mail-config.glade | 4 | ||||
-rw-r--r-- | mail/mail-format.c | 49 |
4 files changed, 61 insertions, 13 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index f9fbb555de..8babbc6bea 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,20 +1,27 @@ +2001-07-26 Jeffrey Stedfast <fejj@ximian.com> + + * mail-format.c (write_headers): Respect Gtk theme colors for the + fonts and calculate a new table gbcolor based on gtk theme + preferences. + + * mail-config.glade: Label the enabled field. + 2001-07-26 Peter Williams <peterw@ximian.com> * message-list.etspec: Make the date column smaller and the subject column larger, relatively. - * mail-folder-cache.c (make_folder_status): Don't display - "0 hidden". + * mail-folder-cache.c (make_folder_status): Don't display "0 + hidden". - * folder-browser.c (on_key_press): Make 'q' a toggle, not - one-way. + * folder-browser.c (on_key_press): Make 'q' a toggle, not one-way. * message-list.etspec: Rename "Date" column to "Sent". 2001-07-25 Anna Marie Dirks <anna@ximian.com> - * mail-config.glade: fixed a mis-spelling of "Fashion" in - the mail accounts window. (See bug 5433) + * mail-config.glade: fixed a mis-spelling of "Fashion" in the mail + accounts window. (See bug 5433) 2001-07-25 Jeffrey Stedfast <fejj@ximian.com> diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c index 7d08295891..a35ec7586b 100644 --- a/mail/mail-accounts.c +++ b/mail/mail-accounts.c @@ -738,7 +738,7 @@ construct (MailAccountsDialog *dialog) /* reparent */ gtk_widget_reparent (notebook, GNOME_DIALOG (dialog)->vbox); - /* give our dialog an OK button and title */ + /* give our dialog an Close button and title */ gtk_window_set_title (GTK_WINDOW (dialog), _("Evolution Account Manager")); gtk_window_set_policy (GTK_WINDOW (dialog), FALSE, TRUE, TRUE); gtk_window_set_default_size (GTK_WINDOW (dialog), 400, 300); diff --git a/mail/mail-config.glade b/mail/mail-config.glade index 9d9853b811..f30a8c6bf6 100644 --- a/mail/mail-config.glade +++ b/mail/mail-config.glade @@ -2153,7 +2153,7 @@ Kerberos <name>clistAccounts</name> <can_focus>True</can_focus> <columns>3</columns> - <column_widths>20,150,80</column_widths> + <column_widths>53,183,38</column_widths> <selection_mode>GTK_SELECTION_SINGLE</selection_mode> <show_titles>True</show_titles> <shadow_type>GTK_SHADOW_IN</shadow_type> @@ -2162,7 +2162,7 @@ Kerberos <class>GtkLabel</class> <child_name>CList:title</child_name> <name>lblEnable</name> - <label></label> + <label>Enabled</label> <justify>GTK_JUSTIFY_CENTER</justify> <wrap>False</wrap> <xalign>0.5</xalign> diff --git a/mail/mail-format.c b/mail/mail-format.c index 795bfefa5d..0bef35aeee 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -864,27 +864,68 @@ write_header (CamelMimeMessage *message, MailDisplay *md, write_text_header (name, value, flags, md->html, md->stream); } +#define COLOR_IS_LIGHT(r, g, b) ((r + g + b) > (128 * 3)) + static void write_headers (CamelMimeMessage *message, MailDisplay *md) { - GArray *gheaders; + gboolean full = (md->display_style == MAIL_CONFIG_DISPLAY_FULL_HEADERS); CamelMediumHeader *headers, default_headers[] = { { "From", NULL }, { "Reply-To", NULL }, { "To", NULL }, { "Cc" , NULL }, { "Subject", NULL }, { "Date", NULL } }; + char bgcolor[7], fontcolor[7]; + GtkStyle *style = NULL; int i, len, flags; - gboolean full = (md->display_style == MAIL_CONFIG_DISPLAY_FULL_HEADERS); + GArray *gheaders; + + /* My favorite thing to do...much around with colors so we respect people's stupid themes */ + style = gtk_widget_get_style (GTK_WIDGET (md->html)); + if (style) { + int state = GTK_WIDGET_STATE (GTK_WIDGET (md->html)); + gushort r, g, b; + + r = style->base[state].red / 256; + g = style->base[state].green / 256; + b = style->base[state].blue / 256; + + if (COLOR_IS_LIGHT (r, g, b)) { + r *= 0.92; + g *= 0.92; + b *= 0.92; + } else { + r = 255 - (0.92 * (255 - r)); + g = 255 - (0.92 * (255 - g)); + b = 255 - (0.92 * (255 - b)); + } + + g_warning ("%d, %d, %d", r, g, b); + sprintf (bgcolor, "%.2X%.2X%.2X", r, g, b); + + r = style->text[state].red; + g = style->text[state].green / 256; + b = style->text[state].blue / 256; + + sprintf (fontcolor, "%.2X%.2X%.2X", r, g, b); + } else { + strcpy (bgcolor, "EEEEEE"); + strcpy (fontcolor, "000000"); + } mail_html_write (md->html, md->stream, "<table width=\"100%%\" cellpadding=0 cellspacing=0>" "<tr><td colspan=3 height=10><table height=10 cellpadding=0 cellspacing=0>" "<tr><td></td></tr></table></td></tr>" "<tr><td><table width=10 cellpadding=0 cellspacing=0><tr><td></td></tr></table></td>" - "<td width=\"100%%\"><font color=\"#000000\">" + "<td width=\"100%%\"><font color=\"#"); + mail_html_write (md->html, md->stream, fontcolor); + mail_html_write (md->html, md->stream, "\">" "<table bgcolor=\"#000000\" width=\"100%%\" " "cellspacing=0 cellpadding=1><tr><td>" - "<table bgcolor=\"#EEEEEE\" width=\"100%%\" cellpadding=0 cellspacing=0>" + "<table bgcolor=\"#"); + mail_html_write (md->html, md->stream, bgcolor); + mail_html_write (md->html, md->stream, "\" width=\"100%%\" cellpadding=0 cellspacing=0>" "<tr><td><table>\n"); if (full) { |