make RoomSettings mobile friendly and more like UserProfile

This commit is contained in:
Malte E 2022-02-25 21:57:19 +01:00
parent 64773898e7
commit fd3efdffcf

View file

@ -17,8 +17,8 @@ ApplicationWindow {
property var roomSettings property var roomSettings
minimumWidth: 450 minimumWidth: 340
minimumHeight: 680 minimumHeight: 340
palette: Nheko.colors palette: Nheko.colors
color: Nheko.colors.window color: Nheko.colors.window
modality: Qt.NonModal modality: Qt.NonModal
@ -29,15 +29,25 @@ ApplicationWindow {
sequence: StandardKey.Cancel sequence: StandardKey.Cancel
onActivated: roomSettingsDialog.close() onActivated: roomSettingsDialog.close()
} }
ScrollHelper {
flickable: flickable
anchors.fill: flickable
}
Flickable {
id: flickable
boundsBehavior: Flickable.StopAtBounds
anchors.fill: parent
clip: true
flickableDirection: Flickable.VerticalFlick
contentWidth: contentLayout1.width
contentHeight: contentLayout1.height
ColumnLayout { ColumnLayout {
id: contentLayout1 id: contentLayout1
width: flickable.width
anchors.fill: parent
anchors.margins: Nheko.paddingMedium
spacing: Nheko.paddingMedium spacing: Nheko.paddingMedium
Avatar { Avatar {
Layout.topMargin: Nheko.paddingMedium
url: roomSettings.roomAvatarUrl.replace("mxc://", "image://MxcImage/") url: roomSettings.roomAvatarUrl.replace("mxc://", "image://MxcImage/")
roomid: roomSettings.roomId roomid: roomSettings.roomId
displayName: roomSettings.roomName displayName: roomSettings.roomName
@ -65,6 +75,7 @@ ApplicationWindow {
visible: opacity > 0 visible: opacity > 0
opacity: 0 opacity: 0
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
wrapMode: Text.Wrap // somehow still doesn't wrap
} }
SequentialAnimation { SequentialAnimation {
@ -93,18 +104,15 @@ ApplicationWindow {
hideErrorAnimation.restart(); hideErrorAnimation.restart();
} }
} }
Label {
ColumnLayout {
Layout.alignment: Qt.AlignHCenter
MatrixText {
text: roomSettings.roomName text: roomSettings.roomName
Layout.alignment: Qt.AlignHCenter
font.pixelSize: fontMetrics.font.pixelSize * 2 font.pixelSize: fontMetrics.font.pixelSize * 2
Layout.fillWidth: true Layout.fillWidth: true
horizontalAlignment: TextEdit.AlignHCenter horizontalAlignment: TextEdit.AlignHCenter
} }
MatrixText { Label {
text: qsTr("%n member(s)", "", roomSettings.memberCount) text: qsTr("%n member(s)", "", roomSettings.memberCount)
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
@ -119,8 +127,6 @@ ApplicationWindow {
} }
}
ImageButton { ImageButton {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
image: ":/icons/icons/ui/edit.svg" image: ":/icons/icons/ui/edit.svg"
@ -128,14 +134,13 @@ ApplicationWindow {
onClicked: roomSettings.openEditModal() onClicked: roomSettings.openEditModal()
} }
ScrollView { TextArea {
Layout.fillHeight: true Layout.fillHeight: true
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: Nheko.paddingLarge Layout.leftMargin: Nheko.paddingLarge
Layout.rightMargin: Nheko.paddingLarge Layout.rightMargin: Nheko.paddingLarge
TextArea {
text: TimelineManager.escapeEmoji(roomSettings.roomTopic) text: TimelineManager.escapeEmoji(roomSettings.roomTopic)
wrapMode: TextEdit.WordWrap wrapMode: TextEdit.WordWrap
textFormat: TextEdit.RichText textFormat: TextEdit.RichText
@ -151,15 +156,14 @@ ApplicationWindow {
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
} }
}
} }
GridLayout { GridLayout {
columns: 2 columns: 2
rowSpacing: Nheko.paddingMedium rowSpacing: Nheko.paddingMedium
Layout.margins: Nheko.paddingMedium
MatrixText { Label {
text: qsTr("SETTINGS") text: qsTr("SETTINGS")
font.bold: true font.bold: true
} }
@ -168,7 +172,7 @@ ApplicationWindow {
Layout.fillWidth: true Layout.fillWidth: true
} }
MatrixText { Label {
text: qsTr("Notifications") text: qsTr("Notifications")
Layout.fillWidth: true Layout.fillWidth: true
} }
@ -182,7 +186,7 @@ ApplicationWindow {
Layout.fillWidth: true Layout.fillWidth: true
} }
MatrixText { Label {
text: qsTr("Room access") text: qsTr("Room access")
Layout.fillWidth: true Layout.fillWidth: true
} }
@ -206,7 +210,7 @@ ApplicationWindow {
Layout.fillWidth: true Layout.fillWidth: true
} }
MatrixText { Label {
text: qsTr("Encryption") text: qsTr("Encryption")
} }
@ -243,7 +247,7 @@ ApplicationWindow {
buttons: Platform.MessageDialog.Ok | Platform.MessageDialog.Cancel buttons: Platform.MessageDialog.Ok | Platform.MessageDialog.Cancel
} }
MatrixText { Label {
text: qsTr("Sticker & Emote Settings") text: qsTr("Sticker & Emote Settings")
} }
@ -254,7 +258,7 @@ ApplicationWindow {
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
} }
MatrixText { Label {
text: qsTr("Hidden events") text: qsTr("Hidden events")
} }
@ -281,7 +285,7 @@ ApplicationWindow {
Layout.fillWidth: true Layout.fillWidth: true
} }
MatrixText { Label {
text: qsTr("INFO") text: qsTr("INFO")
font.bold: true font.bold: true
} }
@ -290,33 +294,31 @@ ApplicationWindow {
Layout.fillWidth: true Layout.fillWidth: true
} }
MatrixText { Label {
text: qsTr("Internal ID") text: qsTr("Internal ID")
} }
MatrixText { Label {
text: roomSettings.roomId text: roomSettings.roomId
font.pixelSize: Math.floor(fontMetrics.font.pixelSize * 0.8) font.pixelSize: Math.floor(fontMetrics.font.pixelSize * 0.8)
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
} }
MatrixText { Label {
text: qsTr("Room Version") text: qsTr("Room Version")
} }
MatrixText { Label {
text: roomSettings.roomVersion text: roomSettings.roomVersion
font.pixelSize: fontMetrics.font.pixelSize font.pixelSize: fontMetrics.font.pixelSize
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
} }
} }
}
DialogButtonBox { }
Layout.fillWidth: true footer: DialogButtonBox {
standardButtons: DialogButtonBox.Ok standardButtons: DialogButtonBox.Ok
onAccepted: close() onAccepted: close()
}
} }
} }