texture-cache: require icon scale to load gicon

To support HiDpi.

https://bugzilla.gnome.org/show_bug.cgi?id=705410
This commit is contained in:
Cosimo Cecchi
2014-02-15 19:43:35 -08:00
parent 65ad65fe52
commit e5e764b402
5 changed files with 54 additions and 16 deletions

View File

@ -848,18 +848,25 @@ shell_startup_sequence_create_icon (ShellStartupSequence *sequence, guint size)
GIcon *themed;
const char *icon_name;
ClutterActor *texture;
gint scale;
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);
icon_name = sn_startup_sequence_get_icon_name ((SnStartupSequence*)sequence);
if (!icon_name)
{
texture = clutter_texture_new ();
clutter_actor_set_size (texture, size, size);
clutter_actor_set_size (texture, size * scale, size * scale);
return texture;
}
themed = g_themed_icon_new (icon_name);
texture = st_texture_cache_load_gicon (st_texture_cache_get_default (),
NULL, themed, size);
NULL, themed, size, scale);
g_object_unref (G_OBJECT (themed));
return texture;
}