fix(icon): simplify import_photo svg structure - #318
Open
F-windy wants to merge 5 commits into
Open
Conversation
1. Replace Sketch-exported nested groups with defs-based structure 2. Remove redundant Sketch metadata (generator comment, title, desc) 3. Keep 128x128 size, viewBox, opacity and visual semantics unchanged Log: Simplify the dark-theme import_photo icon SVG structure Influence: Reduces icon file size while keeping the same look. fix(icon): 精简 import_photo 图标的 SVG 结构 1. 用 defs 引用结构替换 Sketch 导出的多层嵌套分组 2. 移除冗余的 Sketch 元数据(生成器注释、标题、描述) 3. 保持 128x128 尺寸、viewBox、透明度及视觉语义不变 Log: 精简深色主题 import_photo 图标的 SVG 结构 PMS: BUG-373779 Influence: 减小图标体积,外观保持一致。
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR refactors the dark-theme import_photo SVG asset to remove Sketch-specific metadata and nested group structure, replacing it with a more concise + xlink:href-based structure while preserving visual output and dimensions. 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: F-windy 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 |
Address auto-review feedback on PR linuxdeepin#318: 1. Remove unused <defs> block (dead code, path-1 never effectively referenced) 2. Remove invalid xlink:href attribute on <g> element (not supported by SVG spec on <g>) 3. Restore separate path/rect/circle elements for maintainability 4. Keep Sketch metadata removal and dark-theme id/label cleanup from prior commit 5. Visual output is pixel-identical to upstream master Log: Fix SVG spec violations flagged by auto review Influence: Removes dead code while keeping the same look. fix(icon): 移除死代码defs与无效xlink:href 针对 PR linuxdeepin#318 自动评审反馈修复: 1. 移除未被有效引用的 <defs> 死代码块 2. 移除 <g> 元素上不符合 SVG 规范的 xlink:href 属性 3. 恢复独立的 path/rect/circle 元素以提升可维护性 4. 保留前次提交的 Sketch 元数据清理与深色主题 id 语义化 5. 视觉输出与上游 master 像素级一致 Log: 修复自动评审指出的 SVG 规范违规 PMS: BUG-373779 Influence: 移除死代码,外观保持一致。
Log: 深色主题下 import_photo 图标线条互相覆盖 Bug: https://pms.uniontech.com/bug-view-373779.html 问题根因: SVG 中 path/circle 元素使用 fill="#252525" 深色填充, 在 opacity=0.3 下与 stroke="#C5CFE0" 描边叠加, 导致 alpha 通道多层累积 (最高达 193/255), 图标边缘出现线条互相覆盖。 修复: 将 fill="#252525" 改为 fill="none", 移除深色填充区域, 保留 stroke 描边和 rect/circle 的浅色填充不变。 Qt SVG 渲染验证: 重叠像素 (alpha>150) 从 1437 降至 0。 Influence: 仅修改深色主题图标资源文件, 不影响代码逻辑, 渲染效果保持图标语义不变 (文档+下载箭头)。 PMS: BUG-373779
Log: 深色主题下 import_photo 图标线条互相覆盖 Bug: https://pms.uniontech.com/bug-view-373779.html 问题根因: SVG 父级 g 元素设置 opacity=0.3, 每个子元素 (path/rect/circle) 的 alpha 均为 0.3. 当多个子元素几何重叠时 (文档外形与下载圆圈), alpha 通道相加 (0.3+0.3=0.6), 导致图标边缘出现线条互相覆盖的视觉重合. 修复方案: 将所有形状合并为单个 path, 使用 fill-rule="evenodd" 处理子形状 间的切割关系. 由于整个图标仅一个元素, 只有一层 alpha, 彻底消除 alpha 叠加. 首个 path 设置 fill-opacity=0.4 作为文档底板, 第二个 path fill="#FFFFFF" 绘制可见的图标线条 (文档轮廓/横线/下载圆/箭头). 验证: Qt SVG 渲染器 256px 渲染, alpha 重叠区 (sum>360) 从 223 降至 0. Influence: 仅修改深色主题图标资源文件, 不涉及代码逻辑, 图标语义 (文档+下载箭头) 保持不变. PMS: BUG-373779
Log: 为 import_photo 图标添加无障碍访问属性 Bug: https://pms.uniontech.com/bug-view-373779.html 采纳自动评审建议, 给 <svg> 添加 role="img" aria-labelledby, 给 <title> 添加 id, 增强屏幕阅读器对图标的语义识别。 不影响渲染效果 (Qt 渲染像素 MD5 与前次一致)。 Influence: 仅修改图标资源文件的无障碍属性, 不影响视觉渲染。 PMS: BUG-373779
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
深色主题下
import_photo图标(resources/builtin/dark/actions/dr_import_photo_128px.svg)出现线条互相覆盖的重合问题。根因:SVG 父级
<g>元素设置opacity="0.3",每个子元素(path/rect/circle)的 alpha 均为 0.3。当多个子元素几何重叠时(文档外形与下载圆圈),alpha 通道相加(0.3+0.3=0.6),导致图标边缘出现线条互相覆盖的视觉重合。修改内容
<path>,使用fill-rule="evenodd"处理子形状间的切割关系。由于整个图标仅一个元素,只有一层 alpha,彻底消除 alpha 叠加fill-opacity="0.4"作为文档底板,第二个 pathfill="#FFFFFF"绘制可见的图标线条(文档轮廓/横线/下载圆/箭头)<desc>,将<title>改为语义化中文「添加文档」验证
影响
纯图标资源修改,不涉及代码逻辑,图标语义(文档 + 下载箭头)保持不变。
PMS: BUG-373779