From bc1b53a34c8666404bb2220a8c89ff81d10a3026 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 2 Dec 2015 03:18:26 +0100 Subject: css: Query icon theme from style, not from settings No need to look at the settings when the CSS has a property for the icon theme. --- gtk/gtkfilesystem.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'gtk/gtkfilesystem.c') diff --git a/gtk/gtkfilesystem.c b/gtk/gtkfilesystem.c index a26619443b..a69ba905f4 100644 --- a/gtk/gtkfilesystem.c +++ b/gtk/gtkfilesystem.c @@ -21,15 +21,16 @@ #include "config.h" -#include +#include "gtkfilesystem.h" +#include #include #include "gtkfilechooser.h" -#include "gtkfilesystem.h" -#include "gtkicontheme.h" -#include "gtkprivate.h" +#include "gtkcssiconthemevalueprivate.h" #include "gtkintl.h" +#include "gtkprivate.h" +#include "gtkstylecontextprivate.h" /* #define DEBUG_MODE */ #ifdef DEBUG_MODE @@ -707,14 +708,15 @@ get_surface_from_gicon (GIcon *icon, gint icon_size, GError **error) { - GdkScreen *screen; + GtkStyleContext *context; GtkIconTheme *icon_theme; GtkIconInfo *icon_info; GdkPixbuf *pixbuf; cairo_surface_t *surface; - screen = gtk_widget_get_screen (GTK_WIDGET (widget)); - icon_theme = gtk_icon_theme_get_for_screen (screen); + context = gtk_widget_get_style_context (widget); + icon_theme = gtk_css_icon_theme_value_get_icon_theme + (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_ICON_THEME)); icon_info = gtk_icon_theme_lookup_by_gicon_for_scale (icon_theme, icon, @@ -726,7 +728,7 @@ get_surface_from_gicon (GIcon *icon, return NULL; pixbuf = gtk_icon_info_load_symbolic_for_context (icon_info, - gtk_widget_get_style_context (widget), + context, NULL, error); -- cgit v1.2.1