GNOME Bugzilla – Bug 729980
GtkIconTheme: Support looking up directional variants
Last modified: 2014-05-14 22:56:29 UTC
Add two new icon lookup flags, GTK_ICON_LOOKUP_DIR_LTR and _RTL, which tell GtkIconTheme to look for icon variants which have a -ltr or -rtl suffix. GtkIconHelper adds these lookup flags when looking up icons. Note that due to the way this overlaps with symbolic icon lookup, directional variants of symbolic icons must be called -symbolic-rtl, not -rtl-symbolic.
Created attachment 276353 [details] [review] GtkIconTheme: Support looking up directional variants
<Company> mclasen: doesn't that prefer the 2nd icon's ltr version to the first icon's non-ltr version? <mclasen> maybe ? all this copying is a little crazy and is making me dizzy... <Company> I'd have written tests if I had a way to create my own icontheme.. :/ <Company> what you want for foo-bar with FORCE_SYMBOLIC and fallbacks is to try foo-bar-symbolic, foo-symbolic, foo-bar, foo I think <Company> what you want for foo-bar with LTR is to try foo-bar-ltr, foo-bar, foo-ltr, foo <Company> which is a different ordering <Company> but yeah, that function needs to do a better job at ordering the icon names it's looking up <mclasen> what order do you expect for foo-bar-symbolic-rtl ? <Company> foo-bar-symbolic-rtl, foo-bar-symbolic, foo-symbolic-rtl, foo-symbolic, foo-barrtl, foo-bar, foo-rtl, foo <Company> I think? <Company> so the order is <Company> (1) try non-rtl/ltr version <Company> (2) try fallback <Company> (3) try different style <Company> the problem is that (2) is already given to choose_icon() <Company> I think what i'd do in choose_icon is sth like this: <Company> if (flags & LTR) <Company> { <Company> new_names = g_new (n_icon_names * 2 + 1); <Company> new_names[2 * i] = strconcat(names[i], "-rtl"); <Company> new_names[i] = strdup(names[i]); <Company> choose_icon (new_names flags & ~LTR); <Company> } <Company> (man my indenting sucks) <Company> and I forgot the return; in there <Company> that way we strdup icon names like 15 times with all of those flags set, but meh... <mclasen> and one of rtl/ltr will always be set... <mclasen> and symbolic almost always <mclasen> thankfully, we're not showing icons in every button anymore
pushed to the wip/css-icons branch
merged to master