fix: align sidebar layout values to physical pixel grid at fractional…#718
fix: align sidebar layout values to physical pixel grid at fractional…#718Ivy233 wants to merge 2 commits intolinuxdeepin:masterfrom
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 |
… DPR 1. Add Helper.pixelAligned() to snap logical pixel values so that value * DPR always lands on an integer physical pixel 2. Apply pixelAligned() to SideBar spacing, topPadding, bottomPadding and bottomMargin 3. Apply pixelAligned() to WindowedFrame sidebar topMargin, leftMargin and separator leftMargin 4. Apply pixelAligned() to BottomBar padding 5. At fractional DPR (1.25, 1.75), layout values like 10 produce fractional physical coordinates (e.g. 10 * 1.25 = 12.5), causing GPU bilinear interpolation blur on small icon textures during Scene Graph compositing. Snapping to integer physical pixels eliminates this. Log: Fixed sidebar icons appearing blurry at 125%/175% display scaling Influence: 1. Test sidebar icons (Computer, Pictures, Documents, Desktop, Control Center) at 125% and 175% scaling, icons should be sharp 2. Verify icons remain sharp at 100%, 150%, 200% scaling 3. Check bottom bar power and fullscreen button alignment 4. Verify sidebar layout spacing looks visually consistent across different DPR values fix: 修复非整数缩放比例下侧边栏图标模糊问题 1. 在 Helper 中新增 pixelAligned() 函数,将逻辑像素值对齐到整数物理像素 2. 对 SideBar 的 spacing、topPadding、bottomPadding、bottomMargin 应用 pixelAligned() 3. 对 WindowedFrame 中 sidebar 的 topMargin、leftMargin 及分隔线的 leftMargin 应用 pixelAligned() 4. 对 BottomBar 的 padding 应用 pixelAligned() 5. 在非整数 DPR(1.25、1.75)下,布局值如 10 会产生小数物理坐标 (如 10 × 1.25 = 12.5),导致 Scene Graph 合成时 GPU 双线性插值使小图标 纹理模糊。对齐到整数物理像素后即可消除此问题。 Log: 修复了 125%/175% 显示缩放下侧边栏图标模糊的问题 Influence: 1. 在 125% 和 175% 缩放下测试侧边栏图标(计算机、图片、文档、桌面、 控制中心),图标应清晰 2. 验证 100%、150%、200% 缩放下图标仍然清晰 3. 检查底栏电源按钮和全屏按钮的对齐情况 4. 验证不同 DPR 下侧边栏布局间距视觉一致性 PMS: BUG-288427
48063d4 to
ffc1732
Compare
Use QQuickPaintedItem (PaintedDciIcon) to render DCI icons via QPainter instead of the default Scene Graph GPU texture pipeline. This avoids the bilinear interpolation blur that occurs at fractional DPR scaling (e.g., 125%, 175%), matching the rendering quality of dde-file-manager. Affected icons: - Sidebar: sorting mode, arrow, computer, pictures, documents, desktop, settings - Bottom bar: shutdown, fullscreen fix: 使用基于 QPainter 的方式渲染侧边栏和底部栏的 DCI 图标 使用 QQuickPaintedItem(PaintedDciIcon)通过 QPainter 渲染 DCI 图标, 替代默认的 Scene Graph GPU 纹理管线。这避免了在非整数 DPR 缩放 (如 125%、175%)下由双线性插值引起的图标模糊问题, 使渲染质量与 dde-file-manager 一致。 涉及图标: - 侧边栏:排序模式、箭头、计算机、图片、文档、桌面、设置 - 底部栏:关机、全屏 PMS: BUG-288427
deepin pr auto reviewGit Diff 代码审查报告本次代码变更主要涉及新增 1. 语法逻辑1.1 CMakeLists.txt
1.2 PaintedDciIcon 类
1.3 QML 文件
2. 代码质量2.1 PaintedDciIcon 类
2.2 QML 文件
3. 代码性能3.1 PaintedDciIcon 类
3.2 QML 文件
4. 代码安全4.1 PaintedDciIcon 类
4.2 QML 文件
5. 其他建议
总结本次代码变更整体上是合理的,主要改进了图标的渲染方式和像素对齐。主要关注点是性能优化和安全增强,特别是在图标名称验证和调色板缓存方面。建议在后续版本中考虑上述改进意见,以提高代码质量和性能。 |
|
TAG Bot New tag: 2.0.28 |
|
TAG Bot New tag: 2.0.29 |
|
TAG Bot New tag: 2.0.30 |
… DPR
Log: Fixed sidebar icons appearing blurry at 125%/175% display scaling
Influence:
fix: 修复非整数缩放比例下侧边栏图标模糊问题
Log: 修复了 125%/175% 显示缩放下侧边栏图标模糊的问题
Influence:
PMS: BUG-288427