Skip to content

Commit 8335042

Browse files
committed
feat: add override icon search path for system tray
1. Changed resource prefix from /dsg/built-in-icons to /dsg-icon/ override in application-tray.qrc 2. Added DIconTheme include and modified DCI theme search paths in trayplugin.cpp 3. Prepended the override path to ensure system icons take precedence over theme icons 4. This allows system icons to remain consistent regardless of theme changes feat: 为系统托盘添加图标覆盖搜索路径 1. 将 application-tray.qrc 中的资源前缀从 /dsg/built-in-icons 改为 /dsg- icon/override 2. 在 trayplugin.cpp 中添加 DIconTheme 包含并修改 DCI 主题搜索路径 3. 将覆盖路径前置以确保系统图标优先于主题图标 4. 这使得系统图标在不同主题下保持一致性 pms: BUG-332583
1 parent e7cae68 commit 8335042

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

plugins/application-tray/application-tray.qrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<RCC>
2-
<qresource prefix="/dsg/built-in-icons">
2+
<qresource prefix="/dsg-icon/override">
33
<file alias="fcitx-anthy.dci">icons/fcitx-anthy.dci</file>
44
<file alias="fcitx-bopomofo.dci">icons/fcitx-bopomofo.dci</file>
55
<file alias="fcitx-cangjie.dci">icons/fcitx-cangjie.dci</file>

plugins/application-tray/trayplugin.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "ddeindicatortrayprotocol.h"
1212
#include "pluginproxyinterface.h"
1313

14+
#include <DIconTheme>
1415
#include <QDebug>
1516

1617
namespace tray {
@@ -47,6 +48,10 @@ void TrayPlugin::init(PluginProxyInterface *proxyInter)
4748
{
4849
m_proyInter = proxyInter;
4950

51+
auto dciPaths = Dtk::Gui::DIconTheme::dciThemeSearchPaths();
52+
dciPaths.prepend(":/dsg-icon/override");
53+
Dtk::Gui::DIconTheme::setDciThemeSearchPaths(dciPaths);
54+
5055
auto sniProtocol = new SniTrayProtocol();
5156
auto xembedProtocol = new XembedProtocol();
5257
auto indicatorProtocol = new DDEindicatorProtocol();

0 commit comments

Comments
 (0)