[gnome-shell/wip/sass] app: Use StIcon as icon_texture when loading from a GIcon



commit 9645e26ab29af6b36cba61029c2f66ad6955b8dd
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Nov 29 00:25:04 2014 +0000

    app: Use StIcon as icon_texture when loading from a GIcon
    
    Themes - namely the HighContrast one - may now request symbolic
    icons rather than fullcolor ones. In order to have recoloring
    work as expected in that case, we will need a theme node to pick
    up colors from - using an StIcon instead of manually loading a
    texture from the cache gives us that for free, so do that.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=740447

 src/shell-app.c |   20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/src/shell-app.c b/src/shell-app.c
index a16ef5c..2d98eb4 100644
--- a/src/shell-app.c
+++ b/src/shell-app.c
@@ -209,27 +209,23 @@ shell_app_create_icon_texture (ShellApp   *app,
                                int         size)
 {
   GIcon *icon;
-  gint scale;
   ClutterActor *ret;
-  ShellGlobal *global;
-  StThemeContext *context;
-
-  global = shell_global_get ();
-  context = st_theme_context_get_for_stage (shell_global_get_stage (global));
-  g_object_get (context, "scale-factor", &scale, NULL);
-  ret = NULL;
 
   if (app->info == NULL)
     return window_backed_app_get_icon (app, size);
 
+  ret = st_icon_new ();
+  st_icon_set_icon_size (ST_ICON (ret), size);
+
   icon = g_app_info_get_icon (G_APP_INFO (app->info));
   if (icon != NULL)
-    ret = st_texture_cache_load_gicon (st_texture_cache_get_default (), NULL, icon, size, scale);
-
-  if (ret == NULL)
+    {
+      st_icon_set_gicon (ST_ICON (ret), icon);
+    }
+  else
     {
       icon = g_themed_icon_new ("application-x-executable");
-      ret = st_texture_cache_load_gicon (st_texture_cache_get_default (), NULL, icon, size, scale);
+      st_icon_set_gicon (ST_ICON (ret), icon);
       g_object_unref (icon);
     }
 


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