RoomSettings: Port disabled text fields to readOnly

Improves visuals, and allows to select & copy text. Also hides Save
button when there's no chance it would get enabled.

Depends on very recently merged MR in kirigami-addons:
https://invent.kde.org/libraries/kirigami-addons/-/merge_requests/153
This commit is contained in:
ivan tkachenko
2023-09-10 17:28:43 +03:00
parent 2597f0aec9
commit ffd1b06a82

View File

@@ -70,11 +70,10 @@ FormCard.FormCardPage {
id: roomNameField
label: i18n("Room name:")
text: room.name
enabled: room.canSendState("m.room.name")
readOnly: !room.canSendState("m.room.name")
}
FormCard.AbstractFormDelegate {
id: roomTopicField
enabled: room.canSendState("m.room.topic")
background: Item {}
contentItem: ColumnLayout {
QQC2.Label {
@@ -83,14 +82,17 @@ FormCard.FormCardPage {
Layout.fillWidth: true
}
QQC2.TextArea {
id: roomTopicTextArea
Accessible.description: roomTopicLabel.text
Layout.fillWidth: true
text: room.topic
readOnly: !room.canSendState("m.room.topic")
onTextChanged: roomTopicField.text = text
}
}
}
FormCard.AbstractFormDelegate {
visible: !roomNameField.readOnly || !roomTopicTextArea.readOnly
background: Item {}
contentItem: RowLayout {
Item {