forked from openkylin/qt5-ukui-platformtheme
fix: icon theme search path
This commit is contained in:
parent
380a960bb5
commit
316093e5d1
59
debian/patches/0024-fixed-a0625c7-from-https-gitee.com-yangxibowen-qt5-u.patch
vendored
Normal file
59
debian/patches/0024-fixed-a0625c7-from-https-gitee.com-yangxibowen-qt5-u.patch
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
From: guorongfei <guorongfei@cvte.com>
|
||||
Date: Mon, 8 Jan 2024 20:17:39 +0800
|
||||
Subject: fixed a0625c7 from
|
||||
https://gitee.com/yangxibowen/qt5-ukui-platformtheme/pulls/87 fix: icon
|
||||
theme search path
|
||||
|
||||
---
|
||||
qt5-ukui-platformtheme/qt5-ukui-platform-theme.cpp | 16 ++++++++++++++--
|
||||
qt5-ukui-platformtheme/qt5-ukui-platform-theme.h | 3 +++
|
||||
2 files changed, 17 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/qt5-ukui-platformtheme/qt5-ukui-platform-theme.cpp b/qt5-ukui-platformtheme/qt5-ukui-platform-theme.cpp
|
||||
index f70e313..5f4e69a 100644
|
||||
--- a/qt5-ukui-platformtheme/qt5-ukui-platform-theme.cpp
|
||||
+++ b/qt5-ukui-platformtheme/qt5-ukui-platform-theme.cpp
|
||||
@@ -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);
|
||||
diff --git a/qt5-ukui-platformtheme/qt5-ukui-platform-theme.h b/qt5-ukui-platformtheme/qt5-ukui-platform-theme.h
|
||||
index a1b4cbe..086271c 100644
|
||||
--- a/qt5-ukui-platformtheme/qt5-ukui-platform-theme.h
|
||||
+++ b/qt5-ukui-platformtheme/qt5-ukui-platform-theme.h
|
||||
@@ -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;
|
|
@ -21,3 +21,4 @@
|
|||
0021-Update-changelog-4.1.0.0-0k23.patch
|
||||
0022-Add-rounded-corners-for-tabbar-hover-state.patch
|
||||
0023-Refresh-update-changelog-4.1.0.0-0k24.patch
|
||||
0024-fixed-a0625c7-from-https-gitee.com-yangxibowen-qt5-u.patch
|
||||
|
|
Loading…
Reference in New Issue