fix(accounts): correct ComboBox dropdown arrow position in CreateAccountDialog#3345
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis 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
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Consider replacing the hardcoded
8pixel right offset and12x12icon 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>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
TAG Bot New tag: 6.1.99 |
206e4d4 to
1716479
Compare
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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
1716479 to
bcc7590
Compare
|
/forcemerge |
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 修改已符合预期,无需进一步修改,保持当前代码即可
ComboBox {
id: userType
implicitHeight: 30
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
model: dccData.userTypes(true)
} |
|
This pr force merged! (status: blocked) |

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