HLabeledTextField → extensible HLabeledItem

This commit is contained in:
miruka
2020-06-02 20:14:55 -04:00
parent fdaf7089ab
commit e676473f82
11 changed files with 158 additions and 102 deletions

View File

@@ -37,8 +37,8 @@ HBox {
saveFuture = null
}
nameField.field.reset()
topicField.field.reset()
nameField.item.reset()
topicField.item.reset()
encryptCheckBox.reset()
requireInviteCheckbox.reset()
forbidGuestsCheckBox.reset()
@@ -49,11 +49,11 @@ HBox {
property var saveFuture: null
readonly property bool anyChange:
nameField.field.changed || topicField.field.changed ||
nameField.item.changed || topicField.item.changed ||
encryptCheckBox.changed || requireInviteCheckbox.changed ||
forbidGuestsCheckBox.changed
readonly property Item keybindFocusItem: nameField.field
readonly property Item keybindFocusItem: nameField.item
HRoomAvatar {
@@ -69,26 +69,33 @@ HBox {
Layout.alignment: Qt.AlignCenter
}
HLabeledTextField {
HLabeledItem {
id: nameField
label.text: qsTr("Name:")
field.maximumLength: 255
field.defaultText: chat.roomInfo.given_name
field.enabled: chat.roomInfo.can_set_name
Layout.fillWidth: true
Component.onCompleted: field.forceActiveFocus()
HTextField {
width: parent.width
maximumLength: 255
defaultText: chat.roomInfo.given_name
enabled: chat.roomInfo.can_set_name
Component.onCompleted: forceActiveFocus()
}
}
HLabeledTextField {
HLabeledItem {
id: topicField
label.text: qsTr("Topic:")
field.placeholderText: qsTr("This room is about...")
field.defaultText: chat.roomInfo.plain_topic
field.enabled: chat.roomInfo.can_set_topic
Layout.fillWidth: true
HTextField {
width: parent.width
placeholderText: qsTr("This room is about...")
defaultText: chat.roomInfo.plain_topic
enabled: chat.roomInfo.can_set_topic
}
}
HCheckBox {