-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider Qt's fallback search paths when finding icons #259
Conversation
Closes #258 Notes: * For respecting Freedesktop standards, Qt's fallback search paths are taken into account only after inherited paths. * Colorizing of SVG icons is ignored with Qt's fallback paths because it depends on icon themes, not on paths. * To test it, you could do something like this in a code: ```c++ QIcon::setFallbackSearchPaths(QIcon::fallbackSearchPaths() << PARENT_DIR_OF_EXTRA_ICON); anAction->setIcon(QIcon::fromTheme(EXTRA_ICON_NAME)); ```
if (info.entries.isEmpty()) { | ||
// Also, consider Qt's fallback search paths (which are not defined by Freedesktop) | ||
// if the icon is not found in any inherited theme | ||
const auto fallbackPaths = QIcon::fallbackSearchPaths(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you should surround it with:
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
...
#endif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We dropped Qt < 5.15.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only took a glance, yet
Shouldn't
QIcon::fallbackSearchPaths()
just be added to the search paths when calling
QThemeIconInfo XdgIconLoader::unthemedFallback(const QString &iconName, const QStringList &searchPaths)
and that's it ?
I'm I missing something ?
@luis-pereira |
There's nothing special about the If a dash fallback is found in the current theme it will keep a consistent style. If it doesn't then it's a theme design fault. The icon naming guidelines states it. |
We had this discussion years ago. Suppose a developer needs both Then, this patch guarantees that Dash fallbacks should be used as the last resort; otherwise, they'll damge UX. |
Oh, while reading the comments again, I saw that I'd missed this good statement:
Not all but, with |
Yes, it's found but there's no guarantee that it will match the theme. How can a developer guarantee that the
Themes inheritances guarantee some visual similarities. Much more than a random I thought that this was already merged. |
Giving priority to "meaning" over appearance, as it was done before. Merging, to prepare a release… |
Closes #258
Notes: