app: Respect icon-style for faded icon texture
Just like regular application icons, the faded icon texture used in the app menu should follow the theme's icon style setting. https://bugzilla.gnome.org/show_bug.cgi?id=740447
This commit is contained in:
parent
0acc7ed4c2
commit
cad56c871a
@ -237,6 +237,7 @@ typedef struct {
|
|||||||
int size;
|
int size;
|
||||||
int scale;
|
int scale;
|
||||||
ClutterTextDirection direction;
|
ClutterTextDirection direction;
|
||||||
|
StThemeNode *theme_node;
|
||||||
} CreateFadedIconData;
|
} CreateFadedIconData;
|
||||||
|
|
||||||
static CoglHandle
|
static CoglHandle
|
||||||
@ -264,19 +265,28 @@ shell_app_create_faded_icon_cpu (StTextureCache *cache,
|
|||||||
guint8 *pixels;
|
guint8 *pixels;
|
||||||
GIcon *icon;
|
GIcon *icon;
|
||||||
GtkIconInfo *info;
|
GtkIconInfo *info;
|
||||||
|
GtkIconLookupFlags lookup_flags;
|
||||||
|
StIconStyle icon_style;
|
||||||
|
|
||||||
app = data->app;
|
app = data->app;
|
||||||
size = data->size;
|
size = data->size;
|
||||||
scale = data->scale;
|
scale = data->scale;
|
||||||
|
icon_style = st_theme_node_get_icon_style (data->theme_node);
|
||||||
|
|
||||||
info = NULL;
|
info = NULL;
|
||||||
|
|
||||||
|
lookup_flags = GTK_ICON_LOOKUP_FORCE_SIZE;
|
||||||
|
if (icon_style == ST_ICON_STYLE_REGULAR)
|
||||||
|
lookup_flags |= GTK_ICON_LOOKUP_FORCE_REGULAR;
|
||||||
|
else if (icon_style == ST_ICON_STYLE_SYMBOLIC)
|
||||||
|
lookup_flags |= GTK_ICON_LOOKUP_FORCE_SYMBOLIC;
|
||||||
|
|
||||||
icon = g_app_info_get_icon (G_APP_INFO (app->info));
|
icon = g_app_info_get_icon (G_APP_INFO (app->info));
|
||||||
if (icon != NULL)
|
if (icon != NULL)
|
||||||
{
|
{
|
||||||
info = gtk_icon_theme_lookup_by_gicon_for_scale (gtk_icon_theme_get_default (),
|
info = gtk_icon_theme_lookup_by_gicon_for_scale (gtk_icon_theme_get_default (),
|
||||||
icon, size, scale,
|
icon, size, scale,
|
||||||
GTK_ICON_LOOKUP_FORCE_SIZE);
|
lookup_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info == NULL)
|
if (info == NULL)
|
||||||
@ -284,7 +294,7 @@ shell_app_create_faded_icon_cpu (StTextureCache *cache,
|
|||||||
icon = g_themed_icon_new ("application-x-executable");
|
icon = g_themed_icon_new ("application-x-executable");
|
||||||
info = gtk_icon_theme_lookup_by_gicon_for_scale (gtk_icon_theme_get_default (),
|
info = gtk_icon_theme_lookup_by_gicon_for_scale (gtk_icon_theme_get_default (),
|
||||||
icon, size, scale,
|
icon, size, scale,
|
||||||
GTK_ICON_LOOKUP_FORCE_SIZE);
|
lookup_flags);
|
||||||
g_object_unref (icon);
|
g_object_unref (icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,6 +401,7 @@ shell_app_get_faded_icon (ShellApp *app, int size, ClutterTextDirection directio
|
|||||||
data.size = size;
|
data.size = size;
|
||||||
data.scale = scale;
|
data.scale = scale;
|
||||||
data.direction = direction;
|
data.direction = direction;
|
||||||
|
data.theme_node = st_theme_context_get_root_node (context);
|
||||||
texture = st_texture_cache_load (st_texture_cache_get_default (),
|
texture = st_texture_cache_load (st_texture_cache_get_default (),
|
||||||
cache_key,
|
cache_key,
|
||||||
ST_TEXTURE_CACHE_POLICY_FOREVER,
|
ST_TEXTURE_CACHE_POLICY_FOREVER,
|
||||||
|
Loading…
Reference in New Issue
Block a user