Repository navigation
fix: align image device sidebar icon - #837
Open
GongHeng2017 wants to merge 1 commit into
Open
GongHeng2017 wants to merge 1 commit into
GongHeng2017 wants to merge 1 commit into
Conversation
1. Root cause: the sidebar image-device entry used the camera icon key while its display type is Image, so Qt loaded camera_20px.svg and showed a webcam glyph 2. Fix: add 20px light and dark image-device icons, register them in the application resource file, and use image##Image 3. Impact: only the sidebar icon name changes; device discovery, grouping, details, and other sidebar entries remain unchanged Log: fix the image device icon in the device sidebar Influence: 1. Test the image-device sidebar icon in light and dark themes 2. Test the image-device details page after opening and refreshing 3. Check other sidebar icons for unexpected changes fix: 对齐图像设备侧边栏图标 1. 根因:侧边栏图像设备条目使用摄像头图标键,而类型语义为图像设 备,Qt 因此加载 camera_20px.svg 并显示摄像头外观 2. 方案:新增 light/dark 两套 20px 图像设备图标并注册 qrc,侧边栏 映射改为 image##Image 3. 影响:仅侧边栏图标标识变化;设备发现、分组、详情页和其他侧边 栏入口行为保持不变 Log: 修复设备侧边栏中的图像设备图标 Influence: 1. 在 light/dark 主题下测试图像设备侧边栏图标 2. 打开并刷新图像设备详情页后确认列表正常 3. 检查其他侧边栏图标未出现非预期变化 PMS: BUG-274917
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR fixes the Image category’s sidebar icon by aligning its icon key with the existing image-device semantics, adding theme-specific 20px resources, and registering them without changing device discovery, grouping, navigation, or list structure. Sequence diagram for image sidebar icon selectionsequenceDiagram
participant DeviceManager
participant DeviceListView
participant IconResources
DeviceManager->>DeviceManager: getDeviceTypes()
DeviceManager-->>DeviceListView: image##Image
DeviceListView->>IconResources: load image_20px.svg
IconResources-->>DeviceListView: Theme-specific image 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: GongHeng2017 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 |
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.
Root Cause Analysis
The sidebar image-device entry was built with
camera##Image, whileDeviceListViewloads the sidebar icon from the first segment. Consequently, the application loadedcamera_20px.svgand showed a webcam-like glyph for “Image”. The details page already uses the image-device semantic asset, which created the visible mismatch.Key evidence:
deepin-devicemanager/src/DeviceManager/DeviceManager.cpp:248,deepin-devicemanager/src/Widget/DeviceListView.cpp:120, and the existing details-page mapping toimage.svg.修复方案
Add 20px light and dark
imageicons, register both files inappimage.qrc, and change the sidebar mapping fromcamera##Imagetoimage##Image. This follows the approved root-cause-level option and does not change device discovery, grouping, details-page routing, or the return structure ofgetDeviceTypes().Change Safety Assessment
Code Safety
camera##Imageas the sidebar image-device key.DeviceListView.cpp:120consumes the icon segment.Business Impact Scope
The device sidebar icon for the Image category changes from the camera glyph to the semantic image-device glyph in light and dark themes. Device discovery, other sidebar entries, details-page navigation, and the image-device list remain unchanged.
Verification Suggestion
Verify the Image sidebar icon in light/dark themes with an image device present, then open and refresh its details page. Also confirm that the entry is absent when no image device exists and that other sidebar icons show no regression.
根因分析
侧边栏图像设备条目使用了
camera##Image,而DeviceListView按第一段加载侧边栏图标,因此应用实际加载camera_20px.svg并显示类似摄像头的图形。详情页已使用图像设备语义资源,二者形成可见不一致。关键证据:
deepin-devicemanager/src/DeviceManager/DeviceManager.cpp:248、deepin-devicemanager/src/Widget/DeviceListView.cpp:120,以及详情页既有的image.svg映射。修复方案
新增 light/dark 两套 20px
image图标并注册到appimage.qrc,同时将侧边栏映射由camera##Image改为image##Image。该实现遵循已裁决的根因层方案,不改变设备发现、类型分组、详情页跳转或getDeviceTypes()返回结构。改动安全评估
代码安全评估
camera##Image作为图像设备侧边栏标识。DeviceListView.cpp:120使用图标段。业务影响范围
存在图像设备时,“图像设备”侧边栏图标会在 light/dark 主题下由摄像头外观切换为图像设备语义图标。设备发现、其他侧边栏条目、详情页导航和图像设备列表均保持不变。
验证建议
在 light/dark 主题且存在图像设备时验证侧边栏图标,然后打开并刷新详情页。同时确认不存在图像设备时不显示该条目,其他侧边栏图标无回归。
Summary by Sourcery
Bug Fixes: