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:
@@ -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,27 +82,16 @@ 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
|
text: i18n("Save")
|
||||||
contentItem: RowLayout {
|
icon.name: "document-save-symbolic"
|
||||||
Item {
|
onClicked: {
|
||||||
Layout.fillWidth: true
|
if (room.name != roomNameField.text) {
|
||||||
|
room.setName(roomNameField.text);
|
||||||
}
|
}
|
||||||
QQC2.Button {
|
if (room.topic != roomTopicField.text) {
|
||||||
Layout.bottomMargin: Kirigami.Units.smallSpacing
|
room.setTopic(roomTopicField.text);
|
||||||
Layout.topMargin: Kirigami.Units.smallSpacing
|
|
||||||
enabled: room.name !== roomNameField.text || room.topic !== roomTopicField.text
|
|
||||||
text: i18n("Save")
|
|
||||||
icon.name: "document-save-symbolic"
|
|
||||||
onClicked: {
|
|
||||||
if (room.name != roomNameField.text) {
|
|
||||||
room.setName(roomNameField.text);
|
|
||||||
}
|
|
||||||
if (room.topic != roomTopicField.text) {
|
|
||||||
room.setTopic(roomTopicField.text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user