Repository navigation
fix: pass theme type to shortcut viewer via CLI arg - #690
Open
pppanghu77 wants to merge 1 commit into
Open
pppanghu77 wants to merge 1 commit into
pppanghu77 wants to merge 1 commit into
Conversation
1. Root cause: displayShortcuts() launches deepin-shortcut-viewer as a separate process without passing the app palette type, so the viewer reads system theme instead of app theme 2. Fix: add -t=dark/-t=light to shortcutString based on DGuiApplicationHelper::paletteType(); viewer parses -t and calls setPaletteType() to override system theme 3. Impact: shortcut viewer now follows app theme; no behavior change when theme param is absent (backward compatible) Log: fix shortcut panel not following app theme Influence: 1. Test shortcut viewer with light system theme + dark app theme 2. Test shortcut viewer with dark system theme + light app theme 3. Verify shortcut viewer still works without -t parameter fix: 修复快捷键面板未跟随应用主题的问题 1. 根因:displayShortcuts() 启动 deepin-shortcut-viewer 为独立进程 时未传递应用当前调色板类型,导致查看器读取系统主题而非应用主题 2. 方案:根据 DGuiApplicationHelper::paletteType() 向快捷键查看器 传递 -t=dark/-t=light 参数,并在查看器端解析该参数调用 setPaletteType() 设置主题 3. 影响:快捷键面板现在跟随应用主题;未传 -t 参数时行为不变(向后兼容) Log: 修复快捷键面板未跟随应用主题的问题 Influence: 1. 测试系统浅色 + 应用深色时快捷键面板显示 2. 测试系统深色 + 应用浅色时快捷键面板显示 3. 验证未传 -t 参数时快捷键面板仍正常工作 PMS: BUG-374339
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pppanghu77 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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR makes the detached shortcut viewer follow the parent application's light or dark palette by passing an optional -t CLI argument and applying it in the viewer, while preserving existing behavior when no theme override is supplied. Sequence diagram for themed shortcut viewer launchsequenceDiagram
participant App as Application
participant Helper as DGuiApplicationHelper
participant Process as QProcess
participant Viewer as deepin-shortcut-viewer
App->>App: displayShortcuts()
App->>Helper: paletteType()
alt DarkType
App->>Process: startDetached(deepin-shortcut-viewer, -t=dark)
Process->>Viewer: launch with -t=dark
Viewer->>Viewer: setPaletteType(DarkType)
else LightType
App->>Process: startDetached(deepin-shortcut-viewer, -t=light)
Process->>Viewer: launch with -t=light
Viewer->>Viewer: setPaletteType(LightType)
else No theme override
App->>Process: startDetached(deepin-shortcut-viewer)
Process->>Viewer: launch without -t
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: [] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: [] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例本报告由 AI 代码审查工具自动生成 |
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.
fix: pass theme type to shortcut viewer via CLI arg
separate process without passing the app palette type, so the
viewer reads system theme instead of app theme
DGuiApplicationHelper::paletteType(); viewer parses -t and calls
setPaletteType() to override system theme
when theme param is absent (backward compatible)
Log: fix shortcut panel not following app theme
Influence:
fix: 修复快捷键面板未跟随应用主题的问题
时未传递应用当前调色板类型,导致查看器读取系统主题而非应用主题
传递 -t=dark/-t=light 参数,并在查看器端解析该参数调用
setPaletteType() 设置主题
Log: 修复快捷键面板未跟随应用主题的问题
Influence:
PMS: BUG-374339
Summary by Sourcery
Bug Fixes: