Skip to content

fix(accounts): correct ComboBox dropdown arrow position in CreateAccountDialog#3345

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
iCancely:fix/accounts-combobox-arrow
Jul 16, 2026
Merged

fix(accounts): correct ComboBox dropdown arrow position in CreateAccountDialog#3345
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
iCancely:fix/accounts-combobox-arrow

Conversation

@iCancely

@iCancely iCancely commented Jul 8, 2026

Copy link
Copy Markdown
Contributor
  1. Remove padding: 0 from the ComboBox in CreateAccountDialog
  2. DTK ComboBox default padding is 8, which provides proper spacing for the indicator arrow
  3. The explicit padding: 0 was causing the dropdown arrow to sit flush against the right edge

Log: Fix dropdown arrow position in CreateAccountDialog ComboBox

  1. 移除 CreateAccountDialog 中 ComboBox 的 padding: 0
  2. DTK ComboBox 默认 padding 为 8,可为指示器箭头提供合适的间距
  3. 显式的 padding: 0 导致下拉箭头紧贴右边缘

Log: 修复创建账户对话框中 ComboBox 下拉箭头位置偏右的问题
PMS: BUG-369533

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@sourcery-ai

sourcery-ai Bot commented Jul 8, 2026

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

Reviewer's Guide

This PR fixes the visual position of the ComboBox dropdown arrow in CreateAccountDialog by defining a custom indicator icon with explicit positioning and DTK-consistent styling.

File-Level Changes

Change Details Files
Add an explicit ComboBox indicator icon with controlled positioning to fix the dropdown arrow spacing and alignment.
  • Define an indicator delegate for the ComboBox using D.DciIcon instead of relying on the default proxied indicator
  • Position the indicator horizontally with an explicit x-offset from the right edge to restore spacing from the border
  • Vertically center the indicator within the ComboBox using topPadding and availableHeight
  • Constrain the indicator icon size to 12x12 to match design expectations
  • Apply DTK icon palette, control state/theme, and a specific arrow_ordinary_down icon without QIcon fallback to align with DTK visual style
src/plugin-accounts/qml/CreateAccountDialog.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 found 1 issue, and left some high level feedback:

  • Consider replacing the hardcoded 8 pixel right offset and 12x12 icon size with values derived from the control’s padding or style metrics to keep the indicator aligned with theme/layout changes and avoid magic numbers.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider replacing the hardcoded `8` pixel right offset and `12x12` icon size with values derived from the control’s padding or style metrics to keep the indicator aligned with theme/layout changes and avoid magic numbers.

## Individual Comments

### Comment 1
<location path="src/plugin-accounts/qml/CreateAccountDialog.qml" line_range="165-177" />
<code_context>
                 model: dccData.userTypes(true)
                 font: D.DTK.fontManager.t7
+
+                indicator: D.DciIcon {
+                    x: parent.width - width - 8
+                    y: parent.topPadding + (parent.availableHeight - height) / 2
+                    sourceSize {
+                        width: 12
</code_context>
<issue_to_address>
**suggestion:** Prefer anchors over manual x/y positioning for better layout robustness (incl. RTL and padding changes).

Manual `x`/`y` math tied to `parent.width` and `topPadding` is brittle under RTL, padding, font, or scale changes, and reimplements what anchors already handle. For example:

```qml
indicator: D.DciIcon {
    anchors.right: parent.right
    anchors.rightMargin: 8
    anchors.verticalCenter: parent.verticalCenter
}
```

This keeps the indicator aligned across layout directions without recalculating positions.

```suggestion
                indicator: D.DciIcon {
                    anchors.right: parent.right
                    anchors.rightMargin: 8
                    anchors.verticalCenter: parent.verticalCenter
                    sourceSize {
                        width: 12
                        height: 12
                    }
                    palette: D.DTK.makeIconPalette(parent.palette)
                    name: "arrow_ordinary_down"
                    mode: parent.D.ColorSelector.controlState
                    theme: parent.D.ColorSelector.controlTheme
                    fallbackToQIcon: false
                }
```
</issue_to_address>

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.

Comment thread src/plugin-accounts/qml/CreateAccountDialog.qml Outdated
@mhduiy

mhduiy commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

DTK 的 demo 是没有问题的
1783577626669

Comment thread src/plugin-accounts/qml/CreateAccountDialog.qml Outdated
@deepin-bot

deepin-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.99
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3348

@iCancely iCancely force-pushed the fix/accounts-combobox-arrow branch from 206e4d4 to 1716479 Compare July 10, 2026 06:46
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

1. Remove padding: 0 from the ComboBox in CreateAccountDialog
2. DTK ComboBox default padding is 8, which provides proper spacing for the indicator arrow
3. The explicit padding: 0 was causing the dropdown arrow to sit flush against the right edge

Log: Fix dropdown arrow position in CreateAccountDialog ComboBox

fix(accounts): 修复创建账户对话框中账户类型下拉箭头偏右的问题

1. 移除 CreateAccountDialog 中 ComboBox 的 padding: 0
2. DTK ComboBox 默认 padding 为 8,可为指示器箭头提供合适的间距
3. 显式的 padding: 0 导致下拉箭头紧贴右边缘

Log: 修复创建账户对话框中 ComboBox 下拉箭头位置偏右的问题
PMS: BUG-369533
@18202781743 18202781743 force-pushed the fix/accounts-combobox-arrow branch from 1716479 to bcc7590 Compare July 16, 2026 01:33
@18202781743

Copy link
Copy Markdown
Contributor

/forcemerge

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:95分

■ 【总体评价】

代码修复了ComboBox控件的UI布局间距问题,移除了不合理的padding设置。
逻辑正确且符合UI设计规范,无安全风险。

■ 【详细分析】

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

修改位于src/plugin-accounts/qml/CreateAccountDialog.qml文件中的userType ComboBox组件,移除了padding: 0属性。QML中移除可选属性不会导致编译错误,控件将回退到默认的padding值。
潜在问题:无
建议:无需修改

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

移除padding: 0使控件遵循系统主题或默认的间距规范,避免了硬编码导致的UI错位或显示异常,提升了代码的可维护性和UI一致性。
潜在问题:无
建议:建议在提交信息中详细说明移除该属性的原因,便于后续追溯。

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

移除一个简单的属性绑定对渲染性能和内存占用没有实质影响。
潜在问题:无
建议:无需修改

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

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次修改仅涉及UI控件的样式属性调整,不涉及任何外部输入处理、敏感数据操作或系统权限调用,不存在攻击面。

  • 建议:无需安全修复

■ 【改进建议代码示例】

// 修改已符合预期,无需进一步修改,保持当前代码即可
ComboBox {
    id: userType
    implicitHeight: 30
    Layout.alignment: Qt.AlignVCenter
    Layout.fillWidth: true
    model: dccData.userTypes(true)
}

@deepin-bot

deepin-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot deepin-bot Bot merged commit d365e82 into linuxdeepin:master Jul 16, 2026
18 of 20 checks passed
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