From 53b7122d0ef5487ef0ab084d8d3f6d2fdf2a2199 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 31 Mar 2008 10:01:55 +0000 Subject: ** Fix for bug #506347 2008-03-31 Milan Crha ** 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 --- addressbook/ChangeLog | 8 ++++++++ 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,3 +1,11 @@ +2008-03-31 Milan Crha + + ** 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 ** Fix for bug #404241 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, - "" + "
" "
" - "" + "
" "
" "" - "
"); + "
", bg_frame, bg_body); photo = e_contact_get (contact, E_CONTACT_PHOTO); if (!photo) -- cgit v1.2.3