fix(ui): optimize layout and visibility control for list items#3137
Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom Apr 8, 2026
Merged
fix(ui): optimize layout and visibility control for list items#3137deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Conversation
Add visibility control for IconLabel when icon is empty. Adjust padding and margins for better UI consistency. Refactor title object usage. 为图标标签添加可见性控制,优化边距和布局,重构标题对象使用。 Log: 优化列表项布局和可见性控制 PMS: BUG-355249, BUG-308813 Influence: 修复了空图标时的显示问题,统一了UI边距设置,提升了界面一致性。
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts list item layout and margins, introduces visibility control for empty icons, and refactors an accounts section header to use the shared DccTitleObject for consistent UI behavior. Class diagram for updated QML title and editor itemsclassDiagram
class DccObject {
}
class DccTitleObject {
+string name
+string parentName
+string displayName
+bool canSearch
+int weight
+Item parentItem
+onParentItemChanged()
}
class AccountsMain_otherAcountsTitle {
+string id
+string name
+string parentName
+string displayName
+bool canSearch
+int weight
}
class DccEditorItem {
+Item contentItem
}
class IconLabel {
+bool visible
+real spacing
+bool mirrored
+int display
+url icon
}
DccTitleObject --|> DccObject
AccountsMain_otherAcountsTitle --|> DccTitleObject
DccEditorItem o-- IconLabel
DccTitleObject : onParentItemChanged()
DccTitleObject : parentItem.leftPadding = 14
IconLabel : visible = model.item.icon && model.item.icon.length > 0
AccountsMain_otherAcountsTitle : canSearch = settings.canSearch
Flow diagram for IconLabel visibility controlflowchart TD
A[Start list item render] --> B[Read model.item.icon]
B --> C{icon is defined?}
C -->|No| D[Set IconLabel.visible = false]
C -->|Yes| E{icon.length > 0?}
E -->|No| D
E -->|Yes| F[Set IconLabel.visible = true]
D --> G[Render list item without icon]
F --> H[Render list item with icon]
G --> I[End]
H --> I[End]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
mhduiy
approved these changes
Mar 31, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: add-uos, 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 |
|
TAG Bot New tag: 6.1.80 |
Contributor
Author
|
/forcemerge |
|
This pr force merged! (status: behind) |
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.
Add visibility control for IconLabel when icon is empty. Adjust padding and margins for better UI consistency. Refactor title object usage.
为图标标签添加可见性控制,优化边距和布局,重构标题对象使用。
Log: 优化列表项布局和可见性控制
PMS: BUG-355249, BUG-308813
Influence: 修复了空图标时的显示问题,统一了UI边距设置,提升了界面一致性。
Summary by Sourcery
Adjust list item title handling and layout spacing for more consistent UI and correct visibility behavior when icons are absent.
Enhancements: