Conversation
…cher Non-DCI icons (file:/// URLs from absolute icon paths in .desktop files) lack the built-in padding that the DCI format provides. When rendered at the same sourceSize as DCI icons, they fill the entire area and appear visually larger than system application icons. Add a conservative scale factor (0.85) for non-DCI icons in the imageComponent of IconItemDelegate.qml to compensate for the missing DCI padding, aligning their visual size with DCI icons. Log: fix fullscreen launcher icon size inconsistency between DCI and non-DCI icons Bug: https://pms.uniontech.com/bug-view-361477.html
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe fullscreen launcher now renders non-DCI icons at 85% of their previous scale when their source is a Flow diagram for fullscreen icon scale selectionflowchart TD
A[Fullscreen launcher renders icon] --> B[DciIcon receives iconSource]
B --> C{iconSource startsWith file:///}
C -->|Yes| D[Apply nonDciScaleFactor 0.85]
C -->|No| E[Use scale factor 1.0]
D --> F[Render icon]
E --> F[Render icon]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy 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 |
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: [] 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: ['scale属性绑定表达式较长,建议提取三元表达式为独立的只读属性以提升可读性'] 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例// 暂无代码示例本报告由 AI 代码审查工具自动生成 |
|
我们正常的主题图标是有margin的,WPS和驱动的图标都是写死的指向自己安装的图标,且他的图标没有margin,直接铺满,所以看起来比其他的图标大,在逻辑上是没有办法解决的,应用也可以多给一点margin,让图标比其他图标小。该BUG建议不处理 修复方案不合理,关闭 |
Root Cause Analysis
In fullscreen launcher mode, the
DciIconQML element inIconItemDelegate.qmluses the samesourceSize(128) andscalefor all icon sources. However, DCI icons (system apps) are rendered viaDDciIcon::paint()with built-in DCI padding (RegardPaddingsAsSizeflag), making their visible content smaller thansourceSize. Non-DCI icons (third-party apps with absolute icon paths converted tofile:///URLs inappsmodel.cpp:178) have no DCI padding and fill the entiresourceSize × scalearea, causing them to appear visually larger than system app icons.Key evidence:
qml/IconItemDelegate.qml—imageComponentuses identicalsourceSizeandscalefor all icons, not distinguishing DCI vs non-DCIsrc/models/appsmodel.cpp:178— absolute path icons converted tofile:///URLs, becoming non-DCI icon sourcesddciicon.h—RegardPaddingsAsSizeflag andactualSize()confirm DCI padding mechanismFix
Add a conservative scale factor (0.85) for non-DCI icons (detected via
file:///URL prefix) in theimageComponentofIconItemDelegate.qml. DCI icons are completely unaffected (factor = 1.0). The factor compensates for the missing DCI padding, aligning non-DCI icon visual size with DCI icons.Change Safety Assessment
Risk level: Low
imageComponentis a local QML Component with no external callers (0 references found). The change only modifies thescaleproperty — a multiplicative factor on the existing calculation. DCI icons are unaffected. No API changes, no new dependencies.根因分析
全屏启动器模式下,
IconItemDelegate.qml中的DciIconQML 元素对所有图标源使用相同的sourceSize(128)和scale。但 DCI 图标(系统应用)通过DDciIcon::paint()渲染,DCI 格式内置 padding(RegardPaddingsAsSize标志),可见内容区域小于sourceSize。非 DCI 图标(第三方应用,.desktop文件中绝对路径图标在appsmodel.cpp:178转为file:///URL)无 DCI padding,填满整个sourceSize × scale区域,导致视觉上明显大于系统应用图标。修复方案
在
IconItemDelegate.qml的imageComponent中,对非 DCI 图标(通过file:///URL 前缀检测)添加保守的缩减因子(0.85)。DCI 图标完全不受影响(因子 = 1.0)。该因子补偿缺失的 DCI padding,使非 DCI 图标视觉尺寸与 DCI 图标对齐。改动安全评估
风险等级:低
imageComponent是局部 QML Component,无外部调用者(0 引用)。改动仅修改scale属性——在现有计算上乘以一个因子。DCI 图标不受影响。无 API 变更,无新依赖。Summary by Sourcery
Bug Fixes: