Repository navigation
Conversation
1. Root cause: DTK.FloatingPanel uses InWindowBlur which caches
backdrop textures; when the image is scaled up over the toolbar
and then scaled back, stale pixels remain on the panel surface
2. Fix: replace DTK.FloatingPanel with Item { BoxShadow + Rectangle }
using theme-aware translucent colors (palette.window alpha 0.72)
in EditToolbar.qml, EditPropertyPanel.qml, and FullImageView.qml
3. Impact: edit-mode toolbars and crop action panel no longer retain
stale image colors after zoom; visual style matches home toolbar
Log: Edit-mode toolbars no longer retain stale image colors after zoom
Influence:
1. Test edit toolbar after zooming image beyond toolbar then zoom back
2. Test property panel background after image zoom operations
3. Test crop action panel background after image zoom operations
4. Verify toolbar visual style consistency with home screen
fix: 替换编辑工具栏浮动面板为半透明面板
1. 根因:DTK.FloatingPanel 使用 InWindowBlur 缓存背景纹理,图片放大
超过工具栏再缩小时,缓存纹理未刷新导致工具栏残留图片颜色
2. 方案:将 EditToolbar.qml、EditPropertyPanel.qml、FullImageView.qml
三处 FloatingPanel 替换为 Item { BoxShadow + Rectangle } 主题半透明
面板(palette.window alpha 0.72),不依赖纹理缓存
3. 影响:编辑模式工具栏和裁剪操作面板不再残留图片颜色,视觉风格
与首页工具栏一致
Log: 编辑模式工具栏不再在缩放后残留图片颜色
Influence:
1. 测试放大图片超过工具栏再缩小后工具栏背景是否正常
2. 测试图片缩放操作后编辑属性面板背景是否正常
3. 测试图片缩放操作后裁剪操作面板背景是否正常
4. 验证工具栏视觉风格与首页一致性
PMS: BUG-380001
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: JWWTSL 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 removes all three edit-mode FloatingPanel/InWindowBlur usages and implements rounded translucent panels using existing BoxShadow and Rectangle components, preventing stale backdrop pixels after image zooming while preserving accessibility behavior for the crop panel. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: ['在 EditPropertyPanel.qml 和 EditToolbar.qml 的 background Item 上补充 Accessible.ignored: true,保持三处实现一致'] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: ['将重复的面板实现提取为独立的可复用 QML 组件(如 TranslucentPanel.qml),三处引用该组件,避免后续样式修改时需要同步修改三个文件'] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: ['将魔法数字提取为属性常量(如 readonly property int shadowBlur: 20),提升可读性和可维护性'] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例// 建议提取为可复用组件 TranslucentPanel.qml
import QtQuick
import DTK
Item {
id: root
// 命名常量,消除魔法数字
readonly property int shadowBlur: 20
readonly property int shadowOffsetY: 6
readonly property int panelRadius: 18
readonly property real shadowAlpha: 0.24
readonly property real borderAlpha: 0.12
readonly property real backgroundAlpha: 0.72
// 可由外部覆盖的颜色引用
property var themeTextColor: palette.windowText
property var backgroundColor: palette.window
property var shadowBaseColor: palette.shadow
DTK.BoxShadow {
anchors.fill: panelBackground
cornerRadius: panelBackground.radius
hollow: true
shadowBlur: root.shadowBlur
shadowColor: Qt.rgba(root.shadowBaseColor.r,
root.shadowBaseColor.g,
root.shadowBaseColor.b, root.shadowAlpha)
shadowOffsetY: root.shadowOffsetY
}
Rectangle {
id: panelBackground
anchors.fill: parent
border.color: Qt.rgba(root.themeTextColor.r,
root.themeTextColor.g,
root.themeTextColor.b, root.borderAlpha)
border.width: 1
color: Qt.rgba(root.backgroundColor.r,
root.backgroundColor.g,
root.backgroundColor.b, root.backgroundAlpha)
radius: root.panelRadius
}
}
// 使用示例(在 EditPropertyPanel.qml 中):
// background: TranslucentPanel {
// Accessible.ignored: true
// themeTextColor: propertyPanel.themeTextColor
// }本报告由 AI 代码审查工具自动生成 |
Root Cause Analysis
Edit-mode toolbars used
DTK.FloatingPanelwhich relies onInWindowBlurto cache backdrop textures. When an image is zoomed up beyond the toolbar and then scaled back, the cached texture is not refreshed, leaving stale image pixels on the toolbar surface. Git history confirms commit576c01d6previously fixed this by replacingFloatingPanelwith a manual translucent panel, but commit9f647527reverted that fix and added a thirdFloatingPanelinstance, reintroducing the bug.Fix
Replace all three
DTK.FloatingPanelinstances in edit mode withItem { BoxShadow + Rectangle }theme-aware translucent panels (palette.windowalpha 0.72), eliminating theInWindowBlurtexture cache dependency.Accessible.ignored: trueis preserved on the crop action panelItemfor accessibility consistency.Changed files:
src/qml/EditToolbar.qml— toolbar backgroundsrc/qml/EditPropertyPanel.qml— property panel backgroundsrc/qml/FullImageView.qml— crop action panel backgroundChange Safety Assessment
Code Safety
576c01d6BoxShadowandRectangleare existing DTK/QML types already used in the codebaseBusiness Impact Scope
Verification Suggestion
根因分析
编辑模式工具栏使用
DTK.FloatingPanel,其InWindowBlur缓存背景纹理。图片放大超过工具栏再缩小时,缓存纹理未刷新,导致工具栏残留图片颜色。Git 历史显示 commit576c01d6曾修复此问题,但 commit9f647527回退修复并新增第三处FloatingPanel,导致 Bug 复现。修复方案
将编辑模式三处
DTK.FloatingPanel替换为Item { BoxShadow + Rectangle }主题半透明面板,消除InWindowBlur纹理缓存依赖。裁剪操作面板Item保留Accessible.ignored: true维持无障碍行为一致。改动文件:
src/qml/EditToolbar.qml— 工具栏背景src/qml/EditPropertyPanel.qml— 属性面板背景src/qml/FullImageView.qml— 裁剪操作面板背景改动安全评估
代码安全评估
576c01d6中已验证的修复一致BoxShadow和Rectangle为代码库中已有的 DTK/QML 类型业务影响范围
验证建议
PMS: BUG-380001
Summary by Sourcery
Replace edit-mode floating panels with live translucent backgrounds to eliminate stale visual artifacts during image zooming.
Bug Fixes:
Enhancements: