feat: add override icon search path for system tray#369
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR implements an override icon search path for the system tray by updating the QRC resource prefix and modifying the DIconTheme search paths in the tray plugin initialization so that system icons take precedence over theme icons. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
18202781743
approved these changes
Sep 22, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, mhduiy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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
deepin pr auto review我来审查这段代码的变更,从语法逻辑、代码质量、代码性能和代码安全四个方面进行分析: 语法逻辑
代码质量
代码性能
代码安全
改进建议
改进后的代码示例: void TrayPlugin::init(PluginProxyInterface *proxyInter)
{
m_proyInter = proxyInter;
// 静态初始化图标主题路径
static bool pathsInitialized = false;
if (!pathsInitialized) {
auto dciPaths = Dtk::Gui::DIconTheme::dciThemeSearchPaths();
dciPaths.prepend(":/dsg-icon/override");
if (!Dtk::Gui::DIconTheme::setDciThemeSearchPaths(dciPaths)) {
qWarning() << "Failed to set DCI theme search paths";
}
pathsInitialized = true;
}
auto sniProtocol = new SniTrayProtocol();
auto xembedProtocol = new XembedProtocol();
auto indicatorProtocol = new DDEindicatorProtocol();
// ... 其余代码
}这样的改进可以避免重复设置路径,并增加了错误处理机制,提高了代码的健壮性。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: 为系统托盘添加图标覆盖搜索路径
pms: BUG-332583
Summary by Sourcery
New Features:
/dsg-icon/overridein application-tray.qrc and prepend it to the DIconTheme search paths for system tray icons