EditAccount header: match Display name field

This commit is contained in:
miruka 2019-07-24 16:35:38 -04:00
parent c3746fa106
commit 47d30352fa
2 changed files with 12 additions and 4 deletions

View File

@ -17,11 +17,12 @@ HPage {
readonly property var userInfo: users.find(userId)
readonly property bool ready: userInfo && ! userInfo.loading
property string headerName: userInfo ? userInfo.displayName : ""
hideHeaderUnderHeight: avatarPreferredSize
headerLabel.text:
qsTr("Account settings for %1").arg(
Utils.coloredNameHtml(userInfo ? userInfo.displayName : "", userId)
)
headerLabel.text: qsTr("Account settings for %1").arg(
Utils.coloredNameHtml(headerName, userId)
)
HRectangle {
color: ready ? theme.controls.box.background : "transparent"

View File

@ -15,6 +15,8 @@ HGridLayout {
py.callClientCoro(
userId, "set_displayname", [nameField.field.text], () => {
saveButton.nameChangeRunning = false
editAccount.headerName =
Qt.binding(() => userInfo.displayName)
}
)
}
@ -42,6 +44,8 @@ HGridLayout {
aliasField.field.text = aliasField.currentAlias
fileDialog.selectedFile = ""
fileDialog.file = ""
editAccount.headerName = Qt.binding(() => userInfo.displayName)
}
columns: 2
@ -127,6 +131,9 @@ HGridLayout {
HLabeledTextField {
property bool changed: field.text != userInfo.displayName
property string fText: field.text
onFTextChanged: editAccount.headerName = field.text
id: nameField
label.text: qsTr("Display name:")
field.text: userInfo.displayName