summaryrefslogtreecommitdiff
path: root/eel/eel-background.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-05-05 20:52:06 +0200
committerPablo Barciela <[email protected]>2018-05-05 21:52:40 +0200
commite88c26a010b0e3b06317680cdce397ef77c137d4 (patch)
tree215c12eb159cc5a4ab5d4ce5d1c5656a601ec446 /eel/eel-background.c
parentdf750ae2c2def80ff24b989c7f43e64a43f635aa (diff)
downloadcaja-e88c26a010b0e3b06317680cdce397ef77c137d4.tar.bz2
caja-e88c26a010b0e3b06317680cdce397ef77c137d4.tar.xz
avoid deprecated 'gtk_style_context_get_background_color'
Diffstat (limited to 'eel/eel-background.c')
-rw-r--r--eel/eel-background.c20
1 files changed, 16 insertions, 4 deletions
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);
}