From 895a0a2c7fcaa05bf4ea3415276af26bde90b769 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 14 Feb 2012 18:15:59 -0600 Subject: Fix FTB when deprecation warnings are enabled --- libmap/cc-timezone-map.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'libmap') diff --git a/libmap/cc-timezone-map.c b/libmap/cc-timezone-map.c index aeac9a0..ff6eee8 100644 --- a/libmap/cc-timezone-map.c +++ b/libmap/cc-timezone-map.c @@ -743,19 +743,25 @@ cc_timezone_map_draw (GtkWidget *widget, GError *err = NULL; gdouble pointx, pointy; gdouble alpha = 1.0; - GtkStyle *style; char buf[16]; gtk_widget_get_allocation (widget, &alloc); - style = gtk_widget_get_style (widget); - /* Check if insensitive */ - if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE) + if (gtk_widget_get_sensitive (widget)) alpha = 0.5; /* paint background */ +#if GTK_CHECK_VERSION(3,0,0) + GdkRGBA rgba; + gtk_style_context_get_background_color (gtk_widget_get_style_context (widget), + gtk_widget_get_state_flags (widget), + &rgba); + gdk_cairo_set_source_rgba (cr, &rgba); +#else + GtkStyle * style = gtk_widget_get_style (widget); gdk_cairo_set_source_color (cr, &style->bg[gtk_widget_get_state (widget)]); +#endif cairo_paint (cr); gdk_cairo_set_source_pixbuf (cr, priv->background, 0, 0); cairo_paint_with_alpha (cr, alpha); -- cgit v1.2.3