summaryrefslogtreecommitdiff
path: root/gtk/gtkicontheme.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-09-21 14:46:09 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-09-21 14:49:22 -0400
commit964c202c389abd264b8dd7f5858cd827f3540a00 (patch)
tree0e3ec9977f85c79883d05d21247ac2ffda95fe69 /gtk/gtkicontheme.c
parent1b858e4212f45e214d5d253dd0dba57845254a06 (diff)
downloadgtk+-964c202c389abd264b8dd7f5858cd827f3540a00.tar.gz
GtkIconTheme: Repair symbolic fallback with rtl/ltr
For symbolic icons, we prefer symbolics in inherited themes over generic icons in the theme itself. So far this was implemented by looking at icon_name[0] and looking that up in inherited themes if it is symbolic. But with automatic rtl/ltr handling, the first icon name will always have an -rtl or -ltr suffix, and an icon with that suffix is not going to exist in most cases. To fix this, look for shorter icon names too, as long as they are still symbolic. https://bugzilla.gnome.org/show_bug.cgi?id=737000
Diffstat (limited to 'gtk/gtkicontheme.c')
-rw-r--r--gtk/gtkicontheme.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 1dd7566452..ea44a81d63 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -1698,18 +1698,20 @@ real_choose_icon (GtkIconTheme *icon_theme,
for (i = 0; icon_names[i]; i++)
g_print ("\tlookup name: %s\n", icon_names[i]));
- /* for symbolic icons, do a search in all registered themes first;
+ /* For symbolic icons, do a search in all registered themes first;
* a theme that inherits them from a parent theme might provide
* an alternative full-color version, but still expect the symbolic icon
* to show up instead.
+ *
+ * In other words: We prefer symbolic icons in inherited themes over
+ * generic icons in the theme.
*/
- if (icon_names[0] &&
- icon_name_is_symbolic (icon_names[0]))
+ for (l = priv->themes; l; l = l->next)
{
- for (l = priv->themes; l; l = l->next)
+ theme = l->data;
+ for (i = 0; icon_names[i] && icon_name_is_symbolic (icon_names[i]); i++)
{
- theme = l->data;
- icon_name = icon_names[0];
+ icon_name = icon_names[i];
icon_info = theme_lookup_icon (theme, icon_name, size, scale, allow_svg, use_builtin);
if (icon_info)
goto out;