Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Ivy233 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 GuideTyped colors now resolve through the current theme’s standard application palette when no QQuickControl ancestor is available, preserving control-specific behavior otherwise and preventing invalid color results in popup/window contexts. Flow diagram for typed color palette fallbackflowchart TD
A[Resolve target color] --> B{"targetColor.isTypedColor()"}
B -- No --> C["targetColor.color()"]
B -- Yes --> D{m_control available?}
D -- Yes --> E["targetColor.toColor(_d_getControlPalette(m_control))"]
D -- No --> F["targetColor.toColor(DGuiApplicationHelper::standardPalette(state->controlTheme))"]
C --> G[Return valid QColor]
E --> G
F --> G
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
TAG Bot New tag: 6.7.51 |
7d93864 to
1b23d50
Compare
DQuickControlColorSelector::getColorOf() left the color invalid when a typed color (e.g. D.Color.Highlight used by HighlightPanel's backgroundColor) was resolved without any QQuickControl ancestor -- popup/window contexts such as Menu/ArrowListView highlights, or a window-level attached selector. The default-constructed invalid QColor has alpha 255, so HighlightPanel rendered as an opaque black block, and every read of the property printed "ColorSelector: The ... is an invalid color on ...". Fall back to DGuiApplicationHelper::standardPalette() of the current theme, consistent with the inactive-blend branch just below. Verified with a minimal QML scene (HighlightPanel under a plain Item): before, 5 warnings and backgroundColor invalid (#000000); after, no warning and a valid highlight color (#024cca). Also wrap the ListView.highlight HighlightPanel in a Control in the Qt6 Menu/ArrowListView components (qt6/src/qml/Menu.qml and qt6/src/qml/ArrowListView.qml). This gives dtk's own highlight the QQuickControl ancestor that ColorSelector expects, without changing the highlight geometry or z-order. The standard-palette fallback above still covers other control-less contexts (standalone HighlightPanel, window-level selectors). 修复:无 Control 祖先时类型化颜色回退到标准调色板 DQuickControlColorSelector::getColorOf() 在类型化颜色(如 HighlightPanel 的 backgroundColor 使用的 D.Color.Highlight)于无 QQuickControl 祖先的上下文(Menu/ArrowListView 高亮等 popup/window 场景,或窗口级附加 selector)解析时返回无效颜色。默认构造的无效 QColor alpha 为 255,导致 HighlightPanel 被画成不透明黑块,且每次 读取属性都打印 "ColorSelector: The ... is an invalid color on ..."。 回退到当前主题的 DGuiApplicationHelper::standardPalette(),与下方 inactive 混色分支保持一致。已用最小 QML 场景(HighlightPanel 挂在 纯 Item 下)验证:修复前 5 条告警且 backgroundColor 无效(#000000), 修复后无告警且返回有效高亮色(#024cca)。 同时将 Qt6 Menu/ArrowListView 的 ListView.highlight 用 Control 包裹 (qt6/src/qml/Menu.qml、qt6/src/qml/ArrowListView.qml),为 HighlightPanel 提供 ColorSelector 期望的 QQuickControl 祖先,不改变 高亮的几何与 z 序;上述标准调色板回退继续覆盖其他无 Control 场景 (独立 HighlightPanel、窗口级 selector)。 PMS: TASK-394335
1b23d50 to
0064daf
Compare
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: [] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: ["可选:修正预存 TODO 注释中的拼写错误 'confict' -> 'conflict'(ArrowListView.qml 第11行、Menu.qml 第43行),虽非本次引入但可在后续清理。"] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例// 当前实现已正确,无需修改。以下为本次修复的核心逻辑参考: // dquickcontrolpalette.cpp - getColorOf() 中的回退逻辑 if (targetColor.isTypedColor()) {
if (m_control)
colorValue = targetColor.toColor(_d_getControlPalette(m_control));
else
// no control in the parent chain: fall back to standard palette
colorValue = targetColor.toColor(DGuiApplicationHelper::standardPalette(state->controlTheme));
} else {
colorValue = targetColor.color();
}本报告由 AI 代码审查工具自动生成 |
|
TAG Bot New tag: 6.7.52 |
DQuickControlColorSelector::getColorOfColor() left the color invalid when a typed color (e.g. D.Color.Highlight used by HighlightPanel's backgroundColor) was resolved without any QQuickControl ancestor -- popup/window contexts such as Menu/ArrowListView highlights, or a window-level attached selector. The default-constructed invalid QColor has alpha 255, so HighlightPanel rendered as an opaque black block, and every read of the property printed
"ColorSelector: The ... is an invalid color on ...".
Fall back to DGuiApplicationHelper::standardPalette() of the current theme, consistent with the inactive-blend branch just below. Verified with a minimal QML scene (HighlightPanel under a plain Item): before, 5 warnings and backgroundColor invalid (#000000); after, no warning and a valid highlight color (#024cca).
修复:无 Control 祖先时类型化颜色回退到标准调色板
DQuickControlColorSelector::getColorOfColor() 在类型化颜色(如 HighlightPanel 的 backgroundColor 使用的 D.Color.Highlight)于无 QQuickControl 祖先的上下文(Menu/ArrowListView 高亮等 popup/window 场景,或窗口级附加 selector)解析时返回无效颜色。默认构造的无效
QColor alpha 为 255,导致 HighlightPanel 被画成不透明黑块,且每次
读取属性都打印 "ColorSelector: The ... is an invalid color on ..."。
回退到当前主题的 DGuiApplicationHelper::standardPalette(),与下方 inactive 混色分支保持一致。已用最小 QML 场景(HighlightPanel 挂在
纯 Item 下)验证:修复前 5 条告警且 backgroundColor 无效(#000000), 修复后无告警且返回有效高亮色(#024cca)。
PMS: TASK-394335
Summary by Sourcery
Prevent invalid typed-color resolution in popup and window-level highlight contexts by using the current theme’s standard palette as a fallback.
Bug Fixes: