diff options
author | Dan Vrátil <dvratil@redhat.com> | 2012-07-27 18:12:39 +0800 |
---|---|---|
committer | Dan Vrátil <dvratil@redhat.com> | 2012-07-27 18:13:20 +0800 |
commit | 440e43d2894fdd517cc91302d4364b082e7d1d8b (patch) | |
tree | 7c39a2b70fe8bdef99ed1cce3c7b2e6d2406d0cc /widgets | |
parent | e03d9fbc7efba1a0239f85a8cf7339bbad6b1c7d (diff) | |
download | gsoc2013-evolution-440e43d2894fdd517cc91302d4364b082e7d1d8b.tar gsoc2013-evolution-440e43d2894fdd517cc91302d4364b082e7d1d8b.tar.gz gsoc2013-evolution-440e43d2894fdd517cc91302d4364b082e7d1d8b.tar.bz2 gsoc2013-evolution-440e43d2894fdd517cc91302d4364b082e7d1d8b.tar.lz gsoc2013-evolution-440e43d2894fdd517cc91302d4364b082e7d1d8b.tar.xz gsoc2013-evolution-440e43d2894fdd517cc91302d4364b082e7d1d8b.tar.zst gsoc2013-evolution-440e43d2894fdd517cc91302d4364b082e7d1d8b.zip |
Bug #679404 - Read colors for message preview from Gtk theme
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/misc/e-web-view.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c index 5a65ad7155..8d6f9fe8cd 100644 --- a/widgets/misc/e-web-view.c +++ b/widgets/misc/e-web-view.c @@ -1874,9 +1874,26 @@ e_web_view_new (void) void e_web_view_clear (EWebView *web_view) { + GtkStyleContext *style_context; + GtkStateFlags state_flags; + GdkRGBA rgba; + gchar *html; + g_return_if_fail (E_IS_WEB_VIEW (web_view)); - webkit_web_view_load_uri (WEBKIT_WEB_VIEW (web_view), "about:blank"); + style_context = gtk_widget_get_style_context (GTK_WIDGET (web_view)); + state_flags = gtk_widget_get_state_flags (GTK_WIDGET (web_view)); + gtk_style_context_get_background_color ( + style_context, state_flags, &rgba); + + html = g_strdup_printf ( + "<html><head></hea + d><body bgcolor=\"#%06x\"></body></html>", + e_rgba_to_value (&rgba)); + + webkit_web_view_load_html_string (WEBKIT_WEB_VIEW (web_view), html, NULL); + + g_free (html); } void |