From 2db41271af1f4db0be8d6fa68bb4b06d23967eb9 Mon Sep 17 00:00:00 2001 From: infirit Date: Sun, 23 Nov 2014 12:08:15 +0100 Subject: Gtk3: clock-map: Port to GtkStyleContext MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on gnome-panel commit: 40391453286cce55039932d6dc3f741bb74e385f From: Germán Póo-Caamaño --- applets/clock/clock-map.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'applets/clock') diff --git a/applets/clock/clock-map.c b/applets/clock/clock-map.c index 8e02b273..adfe137a 100644 --- a/applets/clock/clock-map.c +++ b/applets/clock/clock-map.c @@ -241,17 +241,23 @@ clock_map_expose (GtkWidget *this, GdkEventExpose *event) #endif { ClockMapPrivate *priv = PRIVATE (this); - GtkStyle *style; #if GTK_CHECK_VERSION (3, 0, 0) int width, height; + GtkStyleContext *context; + GdkRGBA color; + + context = gtk_widget_get_style_context (this); + gtk_style_context_get_color (context, GTK_STATE_FLAG_ACTIVE, &color); #else + GtkStyle *style; GdkWindow *window; GtkAllocation allocation; GdkRectangle region; cairo_t *cr; -#endif style = gtk_widget_get_style (this); +#endif + #if !GTK_CHECK_VERSION (3, 0, 0) window = gtk_widget_get_window (this); gtk_widget_get_allocation (this, &allocation); @@ -294,7 +300,7 @@ clock_map_expose (GtkWidget *this, GdkEventExpose *event) /* draw a simple outline */ #if GTK_CHECK_VERSION (3, 0, 0) cairo_rectangle (cr, 0.5, 0.5, width - 1, height - 1); - gdk_cairo_set_source_color (cr, &style->mid [GTK_STATE_ACTIVE]); + gdk_cairo_set_source_rgba (cr, &color); #else cairo_rectangle ( cr, -- cgit v1.2.1