fix(dock): disable smooth rendering for tray icons#1493
fix(dock): disable smooth rendering for tray icons#1493BLumia merged 1 commit intolinuxdeepin:masterfrom
Conversation
Set smooth: false on icon items to fix rendering artifacts. 修复托盘图标渲染伪影问题,禁用平滑渲染。 Log: 修复托盘图标渲染问题 PMS: BUG-312985 BUG-312991 BUG-306813 BUG-271229 Influence: 托盘和任务栏图标渲染更清晰,避免模糊伪影。
deepin pr auto review这段代码主要针对 QML 中的图像渲染性能进行了优化,通过调整 1. 语法逻辑审查
2. 代码质量审查
3. 代码性能审查
4. 代码安全审查
改进建议针对 原代码: Component.onCompleted: {
if (contentItem) {
contentItem.smooth = false
}
}改进建议 1(如果 contentItem 是 Image): // 假设 btn 是一个 Button 或者其子类,且 contentItem 可以被控制
// 如果无法直接修改 btn 的定义,确保 contentItem 确实是 Image 类型
onContentItemChanged: {
if (contentItem && contentItem.hasOwnProperty("smooth")) {
contentItem.smooth = false
}
}理由: 改进建议 2(通用性更强的写法): // 在 btn 所在的组件定义中
property bool iconSmooth: false
contentItem: Image {
smooth: btn.iconSmooth
// ...
}理由:封装性更好,符合 QML 的组件化设计思想。 总结: |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, re2zero 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 |
Set smooth: false on icon items to fix rendering artifacts.
修复托盘图标渲染伪影问题,禁用平滑渲染。
Log: 修复托盘图标渲染问题
PMS: BUG-312985 BUG-312991 BUG-306813 BUG-271229
Influence: 托盘和任务栏图标渲染更清晰,避免模糊伪影。