mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-08-23 09:46:13 +02:00
Merge branch 'wip/themed-icon' into 'main'
[WIP] gthemedicon: add style variant fallback only if use-default-fallbacks Closes #3376 See merge request GNOME/glib!4116
This commit is contained in:
commit
1c817bac2c
@ -316,25 +316,28 @@ g_themed_icon_update_names (GThemedIcon *themed)
|
||||
else if (is_symbolic)
|
||||
g_free (name);
|
||||
}
|
||||
for (iter = names; iter; iter = iter->next)
|
||||
if (themed->use_default_fallbacks)
|
||||
{
|
||||
gchar *name = (gchar *) iter->data;
|
||||
gchar *variant;
|
||||
gboolean is_symbolic;
|
||||
|
||||
is_symbolic = g_str_has_suffix (name, "-symbolic");
|
||||
if (is_symbolic)
|
||||
variant = g_strndup (name, strlen (name) - 9);
|
||||
else
|
||||
variant = g_strdup_printf ("%s-symbolic", name);
|
||||
if (g_list_find_custom (names, variant, (GCompareFunc) g_strcmp0) ||
|
||||
g_list_find_custom (variants, variant, (GCompareFunc) g_strcmp0))
|
||||
for (iter = names; iter; iter = iter->next)
|
||||
{
|
||||
g_free (variant);
|
||||
continue;
|
||||
}
|
||||
gchar *name = (gchar *) iter->data;
|
||||
gchar *variant;
|
||||
gboolean is_symbolic;
|
||||
|
||||
variants = g_list_prepend (variants, variant);
|
||||
is_symbolic = g_str_has_suffix (name, "-symbolic");
|
||||
if (is_symbolic)
|
||||
variant = g_strndup (name, strlen (name) - 9);
|
||||
else
|
||||
variant = g_strdup_printf ("%s-symbolic", name);
|
||||
if (g_list_find_custom (names, variant, (GCompareFunc) g_strcmp0) ||
|
||||
g_list_find_custom (variants, variant, (GCompareFunc) g_strcmp0))
|
||||
{
|
||||
g_free (variant);
|
||||
continue;
|
||||
}
|
||||
|
||||
variants = g_list_prepend (variants, variant);
|
||||
}
|
||||
}
|
||||
names = g_list_reverse (names);
|
||||
|
||||
@ -350,6 +353,18 @@ g_themed_icon_update_names (GThemedIcon *themed)
|
||||
g_list_free (names);
|
||||
g_list_free (variants);
|
||||
|
||||
g_print ("use_default_fallbacks=%s\n", themed->use_default_fallbacks ? "yes" : "no");
|
||||
|
||||
g_print ("Before (init_names array): ");
|
||||
for (i = 0; themed->init_names[i] != NULL; i++)
|
||||
g_print ("%s, ", themed->init_names[i]);
|
||||
g_print ("\n");
|
||||
|
||||
g_print ("After (names array): ");
|
||||
for (i = 0; themed->names[i] != NULL; i++)
|
||||
g_print ("%s, ", themed->names[i]);
|
||||
g_print ("\n\n");
|
||||
|
||||
g_object_notify (G_OBJECT (themed), "names");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user