[gtksourceview] pixbufhelper: render symbolic icons using widgets style context



commit 690db0ea9a7f4e2c6622b38d50c70046df7031e2
Author: Christian Hergert <christian hergert me>
Date:   Sat Apr 11 15:07:41 2015 -0700

    pixbufhelper: render symbolic icons using widgets style context
    
    If the icon is symbolic, we need to render it using the widgets
    style context so that the symbolic colors match the stylescheme.

 gtksourceview/gtksourcepixbufhelper.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourcepixbufhelper.c b/gtksourceview/gtksourcepixbufhelper.c
index ad8655c..6324f92 100644
--- a/gtksourceview/gtksourcepixbufhelper.c
+++ b/gtksourceview/gtksourcepixbufhelper.c
@@ -292,7 +292,21 @@ from_name (GtkSourcePixbufHelper *helper,
 
        if (info)
        {
-               set_cache (helper, gtk_icon_info_load_icon (info, NULL));
+               GdkPixbuf *pixbuf;
+
+               if (gtk_icon_info_is_symbolic (info))
+               {
+                       GtkStyleContext *context;
+
+                       context = gtk_widget_get_style_context (widget);
+                       pixbuf = gtk_icon_info_load_symbolic_for_context (info, context, NULL, NULL);
+               }
+               else
+               {
+                       pixbuf = gtk_icon_info_load_icon (info, NULL);
+               }
+
+               set_cache (helper, pixbuf);
        }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]