aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/em-format-html-display.c30
2 files changed, 15 insertions, 22 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index f7b1f6af9a..de3868d9b9 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+2008-04-03 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #350308
+
+ * em-format-html-display.c: (efhd_gtkhtml_realise): Make colors only
+ darker, not lighter. Use black in case someone has too dark theme.
+
2008-04-02 Matthew Barnes <mbarnes@redhat.com>
* em-composer-prefs (sig_edit_cb), (em_composer_prefs_new_signature):
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index fa0c4fe620..64dbae3377 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -243,41 +243,27 @@ efhd_gtkhtml_realise(GtkHTML *html, EMFormatHTMLDisplay *efhd)
if (style) {
int state = GTK_WIDGET_STATE(html);
gushort r, g, b;
-#define SCALE (238)
+#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;
- if (r+b+g > 128*3) {
- r = (r*SCALE) >> 8;
- g = (g*SCALE) >> 8;
- b = (b*SCALE) >> 8;
- } else {
- r = 128 - ((SCALE * r) >> 9);
- g = 128 - ((SCALE * g) >> 9);
- b = 128 - ((SCALE * b) >> 9);
- }
+ DARKER (r, 18);
+ DARKER (g, 18);
+ DARKER (b, 18);
efhd->formathtml.body_colour = ((r<<16) | (g<< 8) | b) & 0xffffff;
-#undef SCALE
-#define SCALE (174)
/* 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;
- if (r+b+g > 128*3) {
- r = (r*SCALE) >> 8;
- g = (g*SCALE) >> 8;
- b = (b*SCALE) >> 8;
- } else {
- r = 128 - ((SCALE * r) >> 9);
- g = 128 - ((SCALE * g) >> 9);
- b = 128 - ((SCALE * b) >> 9);
- }
+ DARKER (r, 82);
+ DARKER (g, 82);
+ DARKER (b, 82);
efhd->formathtml.frame_colour = ((r<<16) | (g<< 8) | b) & 0xffffff;
@@ -292,8 +278,8 @@ efhd_gtkhtml_realise(GtkHTML *html, EMFormatHTMLDisplay *efhd)
b = style->text[state].blue >> 8;
efhd->formathtml.text_colour = ((r<<16) | (g<< 8) | b) & 0xffffff;
+#undef DARKER
}
-#undef SCALE
}
static void