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/gui/widgets/eab-contact-display.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'addressbook/gui') 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