-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.5.0, 5.10.1, 5.11.0
-
None
The Icon Theme Specification describes a particular behavior for the lookup of icons and fallback handling:
- Look for exact icon name in current theme
- Look for exact icon name in current theme's parents, recursively
- Look for exact icon name in the "hicolor" fallback theme, which always must come last
- Repeat 1-3 using fallback icon names (i.e., remove dash-separated components from the right)
Unfortunately, QIconLoader uses a different algorithm:
- Forcefully add "hicolor" as parent for every theme in the hierarchy
- Look for exact icon name in current theme
- Look for fallback icon name in current theme
- Repeat 2-3 for the parents of the current theme, which unfortunately due to 1 means that hicolor is searched next instead of last
So, this has two effects:
- No matter the inheritance chain defined in the index.theme files, hicolor is always looked into second, because QIconLoader wrongly adds it as a parent to every theme, instead of ensuring it is used as the very last resort as specified. Instead, Qt should follow the complete inheritance chain (look up all parents recursively), ensuring that hicolor is skipped until the end. To quote the specification, "implementations may add more default themes before "hicolor", but "hicolor" must be last".
- Fallback icon names have priority over looking into the parents. That is, if we're looking for "network-connect", and the current theme has "network" while one of its parents has "network-connect", the former is returned rather than the latter. While this may even be desirable in certain situations, it should at the very least be configurable somehow, because in the general case it seems to make more sense to return a specific icon from an inherited theme over a more general icon from the current theme.