diff options
author | Milan Crha <mcrha@redhat.com> | 2014-07-07 18:51:41 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2014-07-07 18:51:41 +0800 |
commit | 50bda1bad222082488d3d9bc9fe1d0fb3867e974 (patch) | |
tree | 27042fc0a39e4a7f79d920bae88cb29aa5677d10 /libgnomecanvas/gnome-canvas.c | |
parent | 534864b39850ea2354b87419da6dc77538867756 (diff) | |
download | gsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.tar.gz gsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.tar.zst gsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.zip |
Replace GtkStyle usages with GtkStyleContext
This makes evolution depend on theme-defined named colors, namely:
theme_bg_color
theme_base_color
theme_fg_color
theme_text_color
theme_selected_bg_color
theme_selected_fg_color
theme_unfocused_selected_bg_color
theme_unfocused_selected_fg_color
If it's not defined, then a fallback color is used, in the worse case
one of the fallbacks defined in evolution itself.
Diffstat (limited to 'libgnomecanvas/gnome-canvas.c')
-rw-r--r-- | libgnomecanvas/gnome-canvas.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c index 45b383b47f..4d482c5594 100644 --- a/libgnomecanvas/gnome-canvas.c +++ b/libgnomecanvas/gnome-canvas.c @@ -2817,12 +2817,15 @@ gnome_canvas_draw_background (GnomeCanvas *canvas, gint width, gint height) { - GtkStyle *style; + GtkStyleContext *style_context; + GdkRGBA rgba; - style = gtk_widget_get_style (GTK_WIDGET (canvas)); + style_context = gtk_widget_get_style_context (GTK_WIDGET (canvas)); + if (!gtk_style_context_lookup_color (style_context, "theme_bg_color", &rgba)) + gdk_rgba_parse (&rgba, "#aaaaaa"); cairo_save (cr); - gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_NORMAL]); + gdk_cairo_set_source_rgba (cr, &rgba); cairo_paint (cr); cairo_restore (cr); } |