diff options
author | Milan Crha <mcrha@redhat.com> | 2008-03-31 18:01:55 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-03-31 18:01:55 +0800 |
commit | 53b7122d0ef5487ef0ab084d8d3f6d2fdf2a2199 (patch) | |
tree | bfbdd6ccb084b61f4dd32e0cbb2e899b72e16d5b | |
parent | 0e3447e1da95111e3b12f3b3109e4f3e87f809e6 (diff) | |
download | gsoc2013-evolution-53b7122d0ef5487ef0ab084d8d3f6d2fdf2a2199.tar.gz gsoc2013-evolution-53b7122d0ef5487ef0ab084d8d3f6d2fdf2a2199.tar.zst gsoc2013-evolution-53b7122d0ef5487ef0ab084d8d3f6d2fdf2a2199.zip |
** Fix for bug #506347
2008-03-31 Milan Crha <mcrha@redhat.com>
** Fix for bug #506347
* gui/widgets/eab-contact-display.c:
(eab_contact_display_render_compact):
Inherit background colors from actual theme, do not use hardcoded one.
svn path=/trunk/; revision=35290
-rw-r--r-- | addressbook/ChangeLog | 8 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-contact-display.c | 25 |
2 files changed, 30 insertions, 3 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 61e25d03e1..6ac33d7f7c 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,13 @@ 2008-03-31 Milan Crha <mcrha@redhat.com> + ** Fix for bug #506347 + + * gui/widgets/eab-contact-display.c: + (eab_contact_display_render_compact): + Inherit background colors from actual theme, do not use hardcoded one. + +2008-03-31 Milan Crha <mcrha@redhat.com> + ** Fix for bug #404241 * gui/widgets/e-minicard.c: (get_email_location), (add_email_field): diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c index c1e0cf98da..c6a8490b16 100644 --- a/addressbook/gui/widgets/eab-contact-display.c +++ b/addressbook/gui/widgets/eab-contact-display.c @@ -751,14 +751,33 @@ eab_contact_display_render_compact (EABContactDisplay *display, EContact *contac const char *str; char *html; EContactPhoto *photo; + guint bg_frame = 0x000000, bg_body = 0xEEEEEE; + GtkStyle *style; + + style = gtk_widget_get_style (GTK_WIDGET (display)); + if (style) { + gushort r, g, b; + + r = style->black.red >> 8; + g = style->black.green >> 8; + b = style->black.blue >> 8; + bg_frame = ((r << 16) | (g << 8) | b) & 0xffffff; + + #define DARKER(a) (((a) >= 0x22) ? ((a) - 0x22) : 0) + r = DARKER (style->bg[GTK_STATE_NORMAL].red >> 8); + g = DARKER (style->bg[GTK_STATE_NORMAL].green >> 8); + b = DARKER (style->bg[GTK_STATE_NORMAL].blue >> 8); + bg_body = ((r << 16) | (g << 8) | b) & 0xffffff; + #undef DARKER + } gtk_html_stream_printf (html_stream, - "<table width=\"100%%\" cellpadding=1 cellspacing=0 bgcolor=\"#000000\">" + "<table width=\"100%%\" cellpadding=1 cellspacing=0 bgcolor=\"#%06X\">" "<tr><td valign=\"top\">" - "<table width=\"100%%\" cellpadding=0 cellspacing=0 bgcolor=\"#eeeeee\">" + "<table width=\"100%%\" cellpadding=0 cellspacing=0 bgcolor=\"#%06X\">" "<tr><td valign=\"top\">" "<table>" - "<tr><td valign=\"top\">"); + "<tr><td valign=\"top\">", bg_frame, bg_body); photo = e_contact_get (contact, E_CONTACT_PHOTO); if (!photo) |