Improve the general room information form card

We can remove a lot of duplicative labeling here: "Room Information",
"Room Name", "RoomTopic", etc. The "Save" button now looks like a proper
form card element, like it does in the account editor.
This commit is contained in:
Joshua Goins
2025-05-24 15:19:16 -04:00
parent a0e8039d92
commit e2427c0683

View File

@@ -58,14 +58,12 @@ FormCard.FormCardPage {
} }
} }
FormCard.FormHeader {
title: i18n("Room Information")
}
FormCard.FormCard { FormCard.FormCard {
Layout.topMargin: Kirigami.Units.gridUnit
FormCard.FormTextFieldDelegate { FormCard.FormTextFieldDelegate {
id: roomNameField id: roomNameField
label: i18n("Room name:") label: i18nc("@label:textbox Room name", "Name:")
text: room.name text: room.name
readOnly: !room.canSendState("m.room.name") readOnly: !room.canSendState("m.room.name")
} }
@@ -74,7 +72,7 @@ FormCard.FormCardPage {
FormCard.FormTextAreaDelegate { FormCard.FormTextAreaDelegate {
id: roomTopicField id: roomTopicField
label: i18n("Room topic:") label: i18nc("@label:textobx Room topic", "Topic:")
text: room.topic text: room.topic
readOnly: !room.canSendState("m.room.topic") readOnly: !room.canSendState("m.room.topic")
onTextChanged: roomTopicField.text = text onTextChanged: roomTopicField.text = text
@@ -84,17 +82,8 @@ FormCard.FormCardPage {
visible: !roomNameField.readOnly || !roomTopicField.readOnly visible: !roomNameField.readOnly || !roomTopicField.readOnly
} }
FormCard.AbstractFormDelegate { FormCard.FormButtonDelegate {
visible: !roomNameField.readOnly || !roomTopicField.readOnly visible: !roomNameField.readOnly || !roomTopicField.readOnly
background: null
contentItem: RowLayout {
Item {
Layout.fillWidth: true
}
QQC2.Button {
Layout.bottomMargin: Kirigami.Units.smallSpacing
Layout.topMargin: Kirigami.Units.smallSpacing
enabled: room.name !== roomNameField.text || room.topic !== roomTopicField.text
text: i18n("Save") text: i18n("Save")
icon.name: "document-save-symbolic" icon.name: "document-save-symbolic"
onClicked: { onClicked: {
@@ -107,8 +96,6 @@ FormCard.FormCardPage {
} }
} }
} }
}
}
FormCard.FormCard { FormCard.FormCard {
Layout.topMargin: Kirigami.Units.gridUnit Layout.topMargin: Kirigami.Units.gridUnit