Remove _for_theme() variant of st_texture_cache_load_icon_name()
Now that we're using St.Icon in the Javascript, there is no reason to have separate st_texture_cache_load_icon_name() and st_texture_cache_load_icon_name_for_theme(), instead just add the StThemeNode argument to st_texture_cache_load_icon_name(). https://bugzilla.gnome.org/show_bug.cgi?id=633866
This commit is contained in:
parent
0e3431ac47
commit
dc1e23501c
@ -324,11 +324,11 @@ st_icon_update (StIcon *icon)
|
|||||||
if (theme_node)
|
if (theme_node)
|
||||||
{
|
{
|
||||||
StTextureCache *cache = st_texture_cache_get_default ();
|
StTextureCache *cache = st_texture_cache_get_default ();
|
||||||
priv->icon_texture = st_texture_cache_load_icon_name_for_theme (cache,
|
priv->icon_texture = st_texture_cache_load_icon_name (cache,
|
||||||
theme_node,
|
theme_node,
|
||||||
priv->icon_name,
|
priv->icon_name,
|
||||||
priv->icon_type,
|
priv->icon_type,
|
||||||
priv->icon_size);
|
priv->icon_size);
|
||||||
|
|
||||||
if (priv->icon_texture)
|
if (priv->icon_texture)
|
||||||
clutter_actor_set_parent (priv->icon_texture, CLUTTER_ACTOR (icon));
|
clutter_actor_set_parent (priv->icon_texture, CLUTTER_ACTOR (icon));
|
||||||
|
@ -1235,9 +1235,9 @@ st_texture_cache_load_sliced_image (StTextureCache *cache,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* st_texture_cache_load_icon_name_for_theme:
|
* st_texture_cache_load_icon_name:
|
||||||
* @cache: The texture cache instance
|
* @cache: The texture cache instance
|
||||||
* @theme_node: a #StThemeNode
|
* @theme_node: (allow-none): a #StThemeNode
|
||||||
* @name: Name of a themed icon
|
* @name: Name of a themed icon
|
||||||
* @icon_type: the type of icon to load
|
* @icon_type: the type of icon to load
|
||||||
* @size: Size of themed
|
* @size: Size of themed
|
||||||
@ -1249,16 +1249,18 @@ st_texture_cache_load_sliced_image (StTextureCache *cache,
|
|||||||
* Return Value: (transfer none): A new #ClutterTexture for the icon
|
* Return Value: (transfer none): A new #ClutterTexture for the icon
|
||||||
*/
|
*/
|
||||||
ClutterActor *
|
ClutterActor *
|
||||||
st_texture_cache_load_icon_name_for_theme (StTextureCache *cache,
|
st_texture_cache_load_icon_name (StTextureCache *cache,
|
||||||
StThemeNode *theme_node,
|
StThemeNode *theme_node,
|
||||||
const char *name,
|
const char *name,
|
||||||
StIconType icon_type,
|
StIconType icon_type,
|
||||||
gint size)
|
gint size)
|
||||||
{
|
{
|
||||||
ClutterActor *texture;
|
ClutterActor *texture;
|
||||||
GIcon *themed;
|
GIcon *themed;
|
||||||
char *symbolic;
|
char *symbolic;
|
||||||
|
|
||||||
|
g_return_val_if_fail (!(icon_type == ST_ICON_SYMBOLIC && theme_node == NULL), NULL);
|
||||||
|
|
||||||
switch (icon_type)
|
switch (icon_type)
|
||||||
{
|
{
|
||||||
case ST_ICON_APPLICATION:
|
case ST_ICON_APPLICATION:
|
||||||
@ -1273,12 +1275,8 @@ st_texture_cache_load_icon_name_for_theme (StTextureCache *cache,
|
|||||||
symbolic = g_strconcat (name, "-symbolic", NULL);
|
symbolic = g_strconcat (name, "-symbolic", NULL);
|
||||||
themed = g_themed_icon_new_with_default_fallbacks ((const gchar*)symbolic);
|
themed = g_themed_icon_new_with_default_fallbacks ((const gchar*)symbolic);
|
||||||
g_free (symbolic);
|
g_free (symbolic);
|
||||||
if (theme_node)
|
texture = load_gicon_with_colors (cache, themed, size,
|
||||||
texture = load_gicon_with_colors (cache, themed, size,
|
st_theme_node_get_icon_colors (theme_node));
|
||||||
st_theme_node_get_icon_colors (theme_node));
|
|
||||||
else
|
|
||||||
texture = st_texture_cache_load_gicon (cache, themed, size);
|
|
||||||
|
|
||||||
g_object_unref (themed);
|
g_object_unref (themed);
|
||||||
|
|
||||||
return CLUTTER_ACTOR (texture);
|
return CLUTTER_ACTOR (texture);
|
||||||
@ -1294,27 +1292,6 @@ st_texture_cache_load_icon_name_for_theme (StTextureCache *cache,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* st_texture_cache_load_icon_name:
|
|
||||||
* @cache: The texture cache instance
|
|
||||||
* @name: Name of a themed icon
|
|
||||||
* @icon_type: the type of icon to load
|
|
||||||
* @size: Size of themed
|
|
||||||
*
|
|
||||||
* Load a themed icon into a texture. See the #StIconType documentation
|
|
||||||
* for an explanation of how @icon_type affects the returned icon.
|
|
||||||
*
|
|
||||||
* Return Value: (transfer none): A new #ClutterTexture for the icon
|
|
||||||
*/
|
|
||||||
ClutterActor *
|
|
||||||
st_texture_cache_load_icon_name (StTextureCache *cache,
|
|
||||||
const char *name,
|
|
||||||
StIconType icon_type,
|
|
||||||
gint size)
|
|
||||||
{
|
|
||||||
return st_texture_cache_load_icon_name_for_theme (cache, NULL, name, icon_type, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* st_texture_cache_load_uri_async:
|
* st_texture_cache_load_uri_async:
|
||||||
*
|
*
|
||||||
|
@ -79,16 +79,11 @@ ClutterActor *st_texture_cache_bind_pixbuf_property (StTextureCache *cache,
|
|||||||
const char *property_name);
|
const char *property_name);
|
||||||
|
|
||||||
ClutterActor *st_texture_cache_load_icon_name (StTextureCache *cache,
|
ClutterActor *st_texture_cache_load_icon_name (StTextureCache *cache,
|
||||||
|
StThemeNode *theme_node,
|
||||||
const char *name,
|
const char *name,
|
||||||
StIconType icon_type,
|
StIconType icon_type,
|
||||||
gint size);
|
gint size);
|
||||||
|
|
||||||
ClutterActor *st_texture_cache_load_icon_name_for_theme (StTextureCache *cache,
|
|
||||||
StThemeNode *theme_node,
|
|
||||||
const char *name,
|
|
||||||
StIconType icon_type,
|
|
||||||
gint size);
|
|
||||||
|
|
||||||
ClutterActor *st_texture_cache_load_gicon (StTextureCache *cache,
|
ClutterActor *st_texture_cache_load_gicon (StTextureCache *cache,
|
||||||
GIcon *icon,
|
GIcon *icon,
|
||||||
gint size);
|
gint size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user