Skip to content

fix(dcc-plugin): adjust MenuEditor switch and arrow alignment#3339

Open
iCancely wants to merge 1 commit into
linuxdeepin:masterfrom
iCancely:fix/menu-editor-arrow-alignment
Open

fix(dcc-plugin): adjust MenuEditor switch and arrow alignment#3339
iCancely wants to merge 1 commit into
linuxdeepin:masterfrom
iCancely:fix/menu-editor-arrow-alignment

Conversation

@iCancely

@iCancely iCancely commented Jul 6, 2026

Copy link
Copy Markdown
Contributor
  1. Reduce RowLayout spacing from 10px to 8px between switch and arrow icon
  2. Remove redundant visible: active from Loader since active already controls
    component lifecycle
  3. Ensure switch controls are positioned 30px from the list background
    right edge, consistent with the arrow icon's 10px right padding

Log: Fix MenuEditorItem layout so switch and arrow are properly aligned to 30px from the right edge

  1. 将RowLayout间距从10px缩减为8px
  2. 移除Loader上多余的visible: active,active已控制组件加载
  3. 确保开关控件距列表背景右侧30px,与箭头图标的10px右边距对齐

Log: 修复MenuEditorItem布局,使开关和箭头距列表右边缘30px对齐
PMS: BUG-369103

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

CLA Assistant Lite bot:
提交邮箱中包含我们的合作伙伴,但您似乎并非合作伙伴的成员或对接人,请联系相关对接人将您添加至组织之中,或由其重新发起 Pull Request。
The commit email domain belongs to one of our partners, but it seems you are not yet a member of the current organization, please contact the contact person to add you to the organization or let them submit the Pull Request.

You can retrigger this bot by commenting recheck in this Pull Request

@sourcery-ai

sourcery-ai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts layout spacing and visibility handling in DccMenuEditorItem to correctly align the switch relative to the arrow icon and right edge of the menu list.

File-Level Changes

Change Details Files
Refine right-side RowLayout spacing and loader visibility to fix misalignment between the switch and arrow icon.
  • Reduce RowLayout spacing between the editor loader and arrow/icon from 10px to 8px to tighten alignment.
  • Set the editor Loader's visible property to depend on its active state so it does not consume layout space when inactive.
  • Keep the switch controls aligned 30px from the right edge of the list background, consistent with the arrow icon’s right padding by removing extra empty layout space.
src/dde-control-center/plugin/DccMenuEditorItem.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Consider whether the inactive DccLoader should also explicitly set visible: active or visible: !editor for clarity and consistency in how loader visibility is handled.
  • The hard-coded spacing and right offset values (8px, 10px, 30px) might be better expressed via shared constants or theme metrics to keep alignment consistent across similar UI elements.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider whether the inactive `DccLoader` should also explicitly set `visible: active` or `visible: !editor` for clarity and consistency in how loader visibility is handled.
- The hard-coded spacing and right offset values (8px, 10px, 30px) might be better expressed via shared constants or theme metrics to keep alignment consistent across similar UI elements.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@iCancely

iCancely commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA.

@iCancely

iCancely commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

recheck

Comment thread src/dde-control-center/plugin/DccMenuEditorItem.qml Outdated
@iCancely iCancely changed the title fix(dcc-plugin): adjust MenuEditor switch and arrow alignment fix(accounts): correct ComboBox dropdown arrow position in CreateAccountDialog Jul 8, 2026
@iCancely iCancely force-pushed the fix/menu-editor-arrow-alignment branch 2 times, most recently from 570766d to 905ae35 Compare July 8, 2026 08:28
@iCancely iCancely changed the title fix(accounts): correct ComboBox dropdown arrow position in CreateAccountDialog fix(dcc-plugin): adjust MenuEditor switch and arrow alignment Jul 8, 2026
@iCancely iCancely force-pushed the fix/menu-editor-arrow-alignment branch from 905ae35 to acf38b0 Compare July 9, 2026 03:38
1. Reduce RowLayout spacing from 10px to 8px between switch and arrow icon
2. Remove redundant visible: active from Loader since active already controls
   component lifecycle
3. Ensure switch controls are positioned 30px from the list background
   right edge, consistent with the arrow icon's 10px right padding

Log: Fix MenuEditorItem layout so switch and arrow are properly aligned to 30px from the right edge

fix(dcc-plugin): 调整MenuEditor开关和箭头的对齐

1. 将RowLayout间距从10px缩减为8px
2. 移除Loader上多余的visible: active,active已控制组件加载
3. 确保开关控件距列表背景右侧30px,与箭头图标的10px右边距对齐

Log: 修复MenuEditorItem布局,使开关和箭头距列表右边缘30px对齐
PMS: BUG-369103
@mhduiy mhduiy force-pushed the fix/menu-editor-arrow-alignment branch from acf38b0 to 332d10e Compare July 9, 2026 06:16
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:100分

■ 【总体评价】

代码实现了UI布局间距的微调优化,无任何逻辑或安全风险
修改简单明确,完全符合视觉规范调整需求,无需扣分

■ 【详细分析】

  • 1.语法逻辑(完全正确)✓

DccMenuEditorItem.qml文件中rightItem的RowLayout组件spacing属性从10修改为8,QML属性赋值语法完全正确,不影响原有组件的加载和渲染逻辑
潜在问题:无
建议:无需修改

  • 2.代码质量(良好)✓

代码修改精简,直接调整数值以适配视觉规范,未引入冗余代码,保持了原有代码结构的清晰度
潜在问题:无
建议:可考虑将spacing值提取为常量或属性以便统一管理,但针对此类微小调整非必须

  • 3.代码性能(无性能问题)✓

仅修改布局间距数值,不涉及复杂的计算或额外的资源分配,对渲染性能无负面影响
潜在问题:无
建议:无需修改

  • 4.代码安全(存在0个安全漏洞)✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次修改为纯UI布局间距调整,未引入任何外部输入处理、文件操作或敏感权限请求,不存在攻击面

  • 建议:无需安全修复

■ 【改进建议代码示例】

DccEditorItem {
    bottomPadding: bottomInset
    activeFocusOnTab: false
    rightItem: RowLayout {
        spacing: 8
        DccLoader {
            active: !editor
            dccObj: model.item
        }
    }
}

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, iCancely, mhduiy

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants