Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 52cyb 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 GuideThe PR breaks palette.windowText binding loops by restoring its native inherited-foreground behavior, routing state colors directly to text and icon consumers, and adding an explicit icon-palette foreground helper. Review should verify binding-loop elimination, checked/hovered/pressed color correctness, and theme/accent responsiveness. Sequence diagram for explicit state foreground resolutionsequenceDiagram
participant Control
participant ColorSelector
participant DQMLGlobalObject
participant DciIcon
participant Text
Control->>ColorSelector: textColor
Control->>DQMLGlobalObject: makeIconPaletteWithForeground(palette, textColor)
DQMLGlobalObject->>DQMLGlobalObject: makeIconPalette(palette)
DQMLGlobalObject->>DciIcon: setForeground(textColor)
Control->>Text: color = textColor
Control->>DciIcon: palette = iconPalette
Flow diagram for restoring native windowText semanticsflowchart LR
State["Control state changes"] --> Selector["D.ColorSelector resolves state foreground"]
Selector --> Text["Text or Label reads state color directly"]
Selector --> Icons["makeIconPaletteWithForeground sets icon foreground"]
Palette["palette.windowText"] --> Native["Qt-native inherited general foreground"]
Native --> Default["Normal-state default foreground"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
4522a44 to
aaa04b4
Compare
|
TAG Bot New tag: 6.7.49 |
| Q_INVOKABLE DTK_GUI_NAMESPACE::DDciIconPalette makeIconPalette(const QPalette &palette); | ||
| #else | ||
| Q_INVOKABLE DTK_GUI_NAMESPACE::DDciIconPalette makeIconPalette(const QQuickPalette *palette); | ||
| Q_INVOKABLE DTK_GUI_NAMESPACE::DDciIconPalette makeIconPaletteWithForeground(const QQuickPalette *palette, const QColor &foreground); |
| property bool contentFlow | ||
| property Component content | ||
| property D.Palette checkedTextColor: DS.Style.checkedButton.text | ||
| readonly property color resolvedTextColor: { |
There was a problem hiding this comment.
这种应该不需要才对,不应该为了修这个问题而去引入,
93367f3 to
6fc9108
Compare
| D.DciIcon.palette: D.DTK.makeIconPalette(palette) | ||
| palette.windowText: D.ColorSelector.textColor | ||
| D.DciIcon.palette: { | ||
| const iconPalette = D.DTK.makeIconPalette(control.palette) |
| } | ||
| name: "arrow_ordinary_down" | ||
| palette: control.D.DTK.makeIconPalette(control.palette) | ||
| palette: control.D.DciIcon.palette |
There was a problem hiding this comment.
这里不需要用control.D.DciIcon.palette吧,用原来的D.DTK.makeIconPalette(control.palette)应该也可以吧,control不一定是Button,有附加属性DciIcon.palette的值吧,
| D.DciIcon.theme: D.ColorSelector.controlTheme | ||
| D.DciIcon.palette: D.DTK.makeIconPalette(palette) | ||
| palette.windowText: D.ColorSelector.textColor | ||
| D.DciIcon.palette: { |
There was a problem hiding this comment.
感觉这样改有点儿奇怪,这含义有点儿不同,D.DciIcon.palette针对的是dci图标的调色板,只对图标有效,
而palette.windowText针对的是qt的调色板,是通用的,
可能存在没有D.DciIcon.palette 但有palette.windowText的情况,
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 语法正确,逻辑清晰,无需修改。建议在后续维护中保持 DciIcon.palette 构建模式的一致性。 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题:
建议: 建议在 DciIcon.palette 的 inline 函数中添加简要注释,说明移除 palette.windowText 绑定的原因(避免 ColorSelector 输出回写导致绑定循环),便于后续维护者理解。 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 性能良好,资源使用合理。绑定循环修复和 palette 复用模式均对性能有正向影响。 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 存在0个安全漏洞。本次变更为 QML UI 调色板逻辑修复,不涉及用户输入处理、网络操作、文件操作或敏感信息,无安全风险。 💡 改进建议代码示例// 建议在 DciIcon.palette inline 函数中添加注释
D.DciIcon.palette: {
// 从控件调色板构建图标调色板,直接覆盖前景色
// 避免修改 palette.windowText 导致 ColorSelector 绑定循环
const iconPalette = D.DTK.makeIconPalette(control.palette)
iconPalette.foreground = control.D.ColorSelector.textColor
return iconPalette
}本报告由 AI 代码审查工具自动生成 |
|
TAG Bot New tag: 6.7.51 |
1. Remove state-dependent palette.windowText bindings from Button, MenuItem and ItemDelegate to avoid feeding ColorSelector output back into the control palette 2. Build DciIcon.palette from the control palette and override its foreground with the resolved state color, keeping the control palette as a read-only input 3. Make ItemDelegate text and indicator icons share the resolved DciIcon foreground without introducing additional properties 4. Reuse the control's resolved DciIcon.palette in IconButton, WindowButton and ButtonIndicator instead of rebuilding it from the base control palette 5. Preserve background, highlight and highlightForeground roles so future role-specific overrides can be propagated to child icons Influence: 1. Button, MenuItem and ItemDelegate no longer report binding loops for palette.windowText 2. Checked and highlighted text and icons retain their state foreground colors 3. Derived and indicator icons receive the same effective palette as their parent control 4. Verify light/dark theme switching and checked, highlighted and disabled states fix(palette): 使用解析后的图标调色板断开 windowText 绑定环 1. 移除 Button、MenuItem 和 ItemDelegate 中依赖控件状态的 palette.windowText 绑定,避免将 ColorSelector 输出回写到控件调色板 2. 基于控件调色板构造 DciIcon.palette,并在其中覆盖已解析的状态前景色, 使控件调色板保持为只读输入 3. ItemDelegate 的文本和指示图标共用 DciIcon 的有效前景色,不引入额外属性 4. IconButton、WindowButton 和 ButtonIndicator 复用控件已经解析的 DciIcon.palette,不再从基础控件调色板重新构造 5. 保留 background、highlight 和 highlightForeground 等角色,便于后续将 各角色的独立覆盖统一传递给子图标 Influence: 1. Button、MenuItem 和 ItemDelegate 不再报告 palette.windowText 绑定循环 2. 选中和高亮状态下的文本、图标继续使用正确的状态前景色 3. 派生图标和指示图标与父控件使用同一份有效调色板 4. 验证亮暗主题切换以及选中、高亮和禁用状态 PMS: TASK-39241
MenuItem and ItemDelegate to avoid feeding ColorSelector output back
into the control palette
foreground with the resolved state color, keeping the control palette
as a read-only input
DciIcon foreground without introducing additional properties
WindowButton and ButtonIndicator instead of rebuilding it from the
base control palette
future role-specific overrides can be propagated to child icons
Influence:
palette.windowText
colors
their parent control
disabled states
fix(palette): 使用解析后的图标调色板断开 windowText 绑定环
palette.windowText 绑定,避免将 ColorSelector 输出回写到控件调色板
使控件调色板保持为只读输入
DciIcon.palette,不再从基础控件调色板重新构造
各角色的独立覆盖统一传递给子图标
Influence:
PMS: TASK-39241
Summary by Sourcery
Resolve control icon palettes independently from stateful control palette bindings to eliminate binding loops and keep text and icons visually consistent across interaction states.
Bug Fixes:
Enhancements: