From e88c26a010b0e3b06317680cdce397ef77c137d4 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Sat, 5 May 2018 20:52:06 +0200 Subject: avoid deprecated 'gtk_style_context_get_background_color' --- eel/eel-background.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'eel/eel-background.c') diff --git a/eel/eel-background.c b/eel/eel-background.c index 02b4d857..cb4ac2ae 100644 --- a/eel/eel-background.c +++ b/eel/eel-background.c @@ -326,6 +326,7 @@ eel_background_ensure_realized (EelBackground *self) int width, height; GdkWindow *window; GtkStyleContext *style; + GdkRGBA *c; /* Set the default color */ style = gtk_widget_get_style_context (self->details->widget); @@ -334,9 +335,13 @@ eel_background_ensure_realized (EelBackground *self) if (self->details->use_base) { gtk_style_context_add_class (style, GTK_STYLE_CLASS_VIEW); } - gtk_style_context_get_background_color (style, - gtk_style_context_get_state (style), - &self->details->default_color); + + gtk_style_context_get (style, gtk_style_context_get_state (style), + GTK_STYLE_PROPERTY_BACKGROUND_COLOR, + &c, NULL); + self->details->default_color = *c; + gdk_rgba_free (c); + gtk_style_context_restore (style); /* If the window size is the same as last time, don't update */ @@ -1079,7 +1084,14 @@ eel_background_set_dropped_color (EelBackground *self, GtkStyleContext *style = gtk_widget_get_style_context (widget); GdkRGBA bg; - gtk_style_context_get_background_color (style, GTK_STATE_FLAG_NORMAL, &bg); + GdkRGBA *c; + + gtk_style_context_get (style, GTK_STATE_FLAG_NORMAL, + GTK_STYLE_PROPERTY_BACKGROUND_COLOR, + &c, NULL); + bg = *c; + gdk_rgba_free (c); + gradient_spec = gdk_rgba_to_string (&bg); } -- cgit v1.2.1