Skip to content

fix(authentication): improve name editor layout to fill available width#3306

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
Ivy233:fix/authentication-nameeditor-layout
Jun 18, 2026
Merged

fix(authentication): improve name editor layout to fill available width#3306
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
Ivy233:fix/authentication-nameeditor-layout

Conversation

@Ivy233

@Ivy233 Ivy233 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Replace fixed maximum width with fillWidth for the name editor input, and remove redundant spacer item before edit button.

修复用户名输入框的布局方式,使用 fillWidth 自适应填充
替代固定的最大宽度限制,并移除编辑按钮前冗余的占位元素。

Log: 修复认证模块用户名输入框布局,支持自适应宽度
PMS: BUG-365807
Influence: 在控制中心认证模块中编辑用户名时,输入框将自适应填充可用宽度,不再局限于最大200px

@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.

Sorry @Ivy233, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:100分

■ 【总体评价】

代码完美修复了输入框宽度无法自适应拉伸及右侧多余空白的UI布局缺陷
逻辑正确且代码简洁,无任何扣分项

■ 【详细分析】

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

修改将原先基于内容动态计算且硬编码上限的布局方式,替换为标准的填充父容器模式,彻底解决了不同分辨率或长文本场景下的自适应问题
建议:保持当前的布局逻辑即可

  • 2.代码质量(优秀)✓

删除了下方多余的空白占位 Item,使布局结构更加精简清晰;同时补充了右侧 10 像素的边距,与左侧边距保持对称,符合 UI 规范
建议:继续保持此种简洁的布局写法

  • 3.代码性能(高效)✓

移除了对 contentWidth 等属性的实时绑定计算,将宽度分配交由布局引擎一次性处理,降低了布局重计算的开销
建议:无需额外优化

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

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次修改仅涉及 QML 前端 UI 布局属性的调整,不涉及任何数据处理、网络请求、命令执行或权限校验等后端安全敏感操作,无安全风险
建议:无需安全修复

■ 【改进建议代码示例】

LineEdit {
    id: nameEditor
    property int maxLength: 15
    Layout.leftMargin: 10
    Layout.rightMargin: 10
    Layout.fillWidth: true
    implicitHeight: DS.Style.itemDelegate.height
    horizontalAlignment: TextInput.AlignLeft
    text: modelData
}

1. Replace fixed maxWidth with fillWidth for adaptive input width
2. Set input height to 30px with 5px vertical margins (matches
   itemDelegate height)
3. Remove redundant spacer item before edit button
4. Show blue focus border only during editing (focus + !readOnly)
5. Align with Bluetooth rename UI behavior

1. 将输入框从固定宽度改为 fillWidth 自适应填充
2. 设置输入框高度为30px,上下5px边距,保持行高40px
3. 移除编辑按钮前冗余的占位元素
4. 蓝色焦点边框仅在编辑状态(聚焦且非只读)时显示
5. 与蓝牙重命名界面的交互表现保持一致

Log: 优化认证模块用户名输入框布局与焦点边框样式
PMS: BUG-365807
Influence: 编辑用户名时输入框自适应宽度、高度匹配列表项规范,
蓝色焦点边框仅在编辑模式下显示,与蓝牙重命名体验对齐
@Ivy233 Ivy233 force-pushed the fix/authentication-nameeditor-layout branch from 98144c8 to b652f2d Compare June 18, 2026 06:14
@Ivy233 Ivy233 requested review from caixr23 and mhduiy June 18, 2026 06:17
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: caixr23, Ivy233

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

3 similar comments
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: caixr23, Ivy233

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

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: caixr23, Ivy233

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

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: caixr23, Ivy233

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

@Ivy233

Ivy233 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot deepin-bot Bot merged commit c3084dc into linuxdeepin:master Jun 18, 2026
16 of 17 checks passed
@Ivy233 Ivy233 deleted the fix/authentication-nameeditor-layout branch June 18, 2026 06:31
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.

3 participants