forked from openkylin/qt5-ukui-platformtheme
fix: icon theme search path
This commit is contained in:
parent
6c1baa39e7
commit
fb43970942
|
@ -238,8 +238,7 @@ QVariant Qt5UKUIPlatformTheme::themeHint(ThemeHint hint) const
|
|||
case QPlatformTheme::SystemIconFallbackThemeName:
|
||||
return "hicolor";
|
||||
case QPlatformTheme::IconThemeSearchPaths:
|
||||
//FIXME:
|
||||
return QStringList()<<".local/share/icons"<<"/usr/share/icons"<<"/usr/local/share/icons";
|
||||
return xdgIconThemePaths();
|
||||
// case WheelScrollLines:
|
||||
// {
|
||||
// return QVariant(1);
|
||||
|
@ -250,6 +249,19 @@ QVariant Qt5UKUIPlatformTheme::themeHint(ThemeHint hint) const
|
|||
return QPlatformTheme::themeHint(hint);
|
||||
}
|
||||
|
||||
QStringList Qt5UKUIPlatformTheme::xdgIconThemePaths() const {
|
||||
QStringList paths;
|
||||
// Add home directory first in search path
|
||||
const QFileInfo homeIconDir(QDir::homePath() + QLatin1String("/.icons"));
|
||||
if (homeIconDir.isDir())
|
||||
paths.prepend(homeIconDir.absoluteFilePath());
|
||||
|
||||
paths.append(QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
|
||||
QStringLiteral("icons"),
|
||||
QStandardPaths::LocateDirectory));
|
||||
return paths;
|
||||
}
|
||||
|
||||
QIconEngine *Qt5UKUIPlatformTheme::createIconEngine(const QString &iconName) const
|
||||
{
|
||||
// QPluginLoader l(XDG_ICON_ENGINE_PATH);
|
||||
|
|
|
@ -89,6 +89,9 @@ public:
|
|||
public Q_SLOTS:
|
||||
void slotChangeStyle(const QString& key);
|
||||
|
||||
private:
|
||||
QStringList xdgIconThemePaths() const;
|
||||
|
||||
private:
|
||||
QFont m_system_font;
|
||||
QFont m_fixed_font;
|
||||
|
|
Loading…
Reference in New Issue