Skip to content

Commit b652f2d

Browse files
committed
fix(authentication): improve name editor layout and add focus border
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: 编辑用户名时输入框自适应宽度、高度匹配列表项规范, 蓝色焦点边框仅在编辑模式下显示,与蓝牙重命名体验对齐
1 parent 3d19e0c commit b652f2d

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/plugin-authentication/qml/AuthenticationMain.qml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,11 @@ DccObject {
146146
id: nameEditor
147147
property int maxLength: 15
148148
Layout.leftMargin: 10
149-
Layout.minimumWidth: contentWidth + leftPadding + rightPadding
150-
Layout.maximumWidth: 200
151-
implicitHeight: DS.Style.itemDelegate.height
149+
Layout.rightMargin: 10
150+
Layout.fillWidth: true
151+
implicitHeight: 30
152+
Layout.topMargin: 5
153+
Layout.bottomMargin: 5
152154
horizontalAlignment: TextInput.AlignLeft
153155
text: modelData
154156
readOnly: true
@@ -157,7 +159,7 @@ DccObject {
157159
background: D.EditPanel {
158160
id: nameEditPanel
159161
control: nameEditor
160-
showBorder: false
162+
showBorder: nameEditor.activeFocus && !nameEditor.readOnly
161163
alertDuration: 3000
162164
backgroundColor: D.Palette {
163165
normal: Qt.rgba(1, 1, 1, 0)
@@ -255,9 +257,6 @@ DccObject {
255257
}
256258
}
257259

258-
Item {
259-
Layout.fillWidth: true
260-
}
261260
D.ActionButton {
262261
id: editButton
263262
visible: hoverHandler.hovered || layout.showActions

0 commit comments

Comments
 (0)