clean up indentation

This commit is contained in:
Malte E 2022-02-25 21:59:01 +01:00
parent fd3efdffcf
commit e59468f28c
1 changed files with 228 additions and 228 deletions

View File

@ -41,105 +41,105 @@ ApplicationWindow {
flickableDirection: Flickable.VerticalFlick flickableDirection: Flickable.VerticalFlick
contentWidth: contentLayout1.width contentWidth: contentLayout1.width
contentHeight: contentLayout1.height contentHeight: contentLayout1.height
ColumnLayout { ColumnLayout {
id: contentLayout1 id: contentLayout1
width: flickable.width width: flickable.width
spacing: Nheko.paddingMedium spacing: Nheko.paddingMedium
Avatar { Avatar {
Layout.topMargin: Nheko.paddingMedium 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
height: 130 height: 130
width: 130 width: 130
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
onClicked: { onClicked: {
if (roomSettings.canChangeAvatar) if (roomSettings.canChangeAvatar)
roomSettings.updateAvatar(); roomSettings.updateAvatar();
} }
} }
Spinner { Spinner {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
visible: roomSettings.isLoading visible: roomSettings.isLoading
foreground: Nheko.colors.mid foreground: Nheko.colors.mid
running: roomSettings.isLoading running: roomSettings.isLoading
} }
Text { Text {
id: errorText id: errorText
color: "red" color: "red"
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 wrapMode: Text.Wrap // somehow still doesn't wrap
} }
SequentialAnimation { SequentialAnimation {
id: hideErrorAnimation id: hideErrorAnimation
running: false running: false
PauseAnimation { PauseAnimation {
duration: 4000 duration: 4000
} }
NumberAnimation { NumberAnimation {
target: errorText target: errorText
property: 'opacity' property: 'opacity'
to: 0 to: 0
duration: 1000 duration: 1000
} }
} }
Connections { Connections {
target: roomSettings target: roomSettings
function onDisplayError(errorMessage) { function onDisplayError(errorMessage) {
errorText.text = errorMessage; errorText.text = errorMessage;
errorText.opacity = 1; errorText.opacity = 1;
hideErrorAnimation.restart(); hideErrorAnimation.restart();
} }
} }
Label { Label {
text: roomSettings.roomName text: roomSettings.roomName
Layout.alignment: Qt.AlignHCenter
font.pixelSize: fontMetrics.font.pixelSize * 2
Layout.fillWidth: true
horizontalAlignment: TextEdit.AlignHCenter
}
Label {
text: qsTr("%n member(s)", "", roomSettings.memberCount)
Layout.alignment: Qt.AlignHCenter
TapHandler {
onSingleTapped: TimelineManager.openRoomMembers(Rooms.getRoomById(roomSettings.roomId))
}
CursorShape {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
}
}
ImageButton {
Layout.alignment: Qt.AlignHCenter
image: ":/icons/icons/ui/edit.svg"
visible: roomSettings.canChangeNameAndTopic
onClicked: roomSettings.openEditModal()
}
TextArea {
Layout.fillHeight: true
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
font.pixelSize: fontMetrics.font.pixelSize * 2
Layout.fillWidth: true Layout.fillWidth: true
horizontalAlignment: TextEdit.AlignHCenter Layout.leftMargin: Nheko.paddingLarge
} Layout.rightMargin: Nheko.paddingLarge
Label {
text: qsTr("%n member(s)", "", roomSettings.memberCount)
Layout.alignment: Qt.AlignHCenter
TapHandler {
onSingleTapped: TimelineManager.openRoomMembers(Rooms.getRoomById(roomSettings.roomId))
}
CursorShape {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
}
}
ImageButton {
Layout.alignment: Qt.AlignHCenter
image: ":/icons/icons/ui/edit.svg"
visible: roomSettings.canChangeNameAndTopic
onClicked: roomSettings.openEditModal()
}
TextArea {
Layout.fillHeight: true
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
Layout.leftMargin: Nheko.paddingLarge
Layout.rightMargin: Nheko.paddingLarge
text: TimelineManager.escapeEmoji(roomSettings.roomTopic) text: TimelineManager.escapeEmoji(roomSettings.roomTopic)
wrapMode: TextEdit.WordWrap wrapMode: TextEdit.WordWrap
@ -156,167 +156,167 @@ ApplicationWindow {
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
} }
}
GridLayout {
columns: 2
rowSpacing: Nheko.paddingMedium
Layout.margins: Nheko.paddingMedium
Label {
text: qsTr("SETTINGS")
font.bold: true
} }
Item { GridLayout {
Layout.fillWidth: true columns: 2
} rowSpacing: Nheko.paddingMedium
Layout.margins: Nheko.paddingMedium
Label { Label {
text: qsTr("Notifications") text: qsTr("SETTINGS")
Layout.fillWidth: true font.bold: true
}
ComboBox {
model: [qsTr("Muted"), qsTr("Mentions only"), qsTr("All messages")]
currentIndex: roomSettings.notifications
onActivated: {
roomSettings.changeNotifications(index);
} }
Layout.fillWidth: true
}
Label { Item {
text: qsTr("Room access") Layout.fillWidth: true
Layout.fillWidth: true
}
ComboBox {
enabled: roomSettings.canChangeJoinRules
model: {
let opts = [qsTr("Anyone and guests"), qsTr("Anyone"), qsTr("Invited users")];
if (roomSettings.supportsKnocking)
opts.push(qsTr("By knocking"));
if (roomSettings.supportsRestricted)
opts.push(qsTr("Restricted by membership in other rooms"));
return opts;
} }
currentIndex: roomSettings.accessJoinRules
onActivated: { Label {
roomSettings.changeAccessRules(index); text: qsTr("Notifications")
Layout.fillWidth: true
} }
Layout.fillWidth: true
}
Label { ComboBox {
text: qsTr("Encryption") model: [qsTr("Muted"), qsTr("Mentions only"), qsTr("All messages")]
} currentIndex: roomSettings.notifications
onActivated: {
ToggleButton { roomSettings.changeNotifications(index);
id: encryptionToggle
checked: roomSettings.isEncryptionEnabled
onCheckedChanged: {
if (roomSettings.isEncryptionEnabled) {
checked = true;
return ;
} }
confirmEncryptionDialog.open(); Layout.fillWidth: true
} }
Layout.alignment: Qt.AlignRight
}
Platform.MessageDialog { Label {
id: confirmEncryptionDialog text: qsTr("Room access")
Layout.fillWidth: true
title: qsTr("End-to-End Encryption")
text: qsTr("Encryption is currently experimental and things might break unexpectedly. <br>
Please take note that it can't be disabled afterwards.")
modality: Qt.NonModal
onAccepted: {
if (roomSettings.isEncryptionEnabled)
return ;
roomSettings.enableEncryption();
} }
onRejected: {
encryptionToggle.checked = false; ComboBox {
enabled: roomSettings.canChangeJoinRules
model: {
let opts = [qsTr("Anyone and guests"), qsTr("Anyone"), qsTr("Invited users")];
if (roomSettings.supportsKnocking)
opts.push(qsTr("By knocking"));
if (roomSettings.supportsRestricted)
opts.push(qsTr("Restricted by membership in other rooms"));
return opts;
}
currentIndex: roomSettings.accessJoinRules
onActivated: {
roomSettings.changeAccessRules(index);
}
Layout.fillWidth: true
} }
buttons: Platform.MessageDialog.Ok | Platform.MessageDialog.Cancel
}
Label { Label {
text: qsTr("Sticker & Emote Settings") text: qsTr("Encryption")
} }
Button { ToggleButton {
text: qsTr("Change") id: encryptionToggle
ToolTip.text: qsTr("Change what packs are enabled, remove packs or create new ones")
onClicked: TimelineManager.openImagePackSettings(roomSettings.roomId)
Layout.alignment: Qt.AlignRight
}
Label { checked: roomSettings.isEncryptionEnabled
text: qsTr("Hidden events") onCheckedChanged: {
} if (roomSettings.isEncryptionEnabled) {
checked = true;
return ;
}
confirmEncryptionDialog.open();
}
Layout.alignment: Qt.AlignRight
}
HiddenEventsDialog { Platform.MessageDialog {
id: hiddenEventsDialog id: confirmEncryptionDialog
roomid: roomSettings.roomId
roomName: roomSettings.roomName
}
Button { title: qsTr("End-to-End Encryption")
text: qsTr("Configure") text: qsTr("Encryption is currently experimental and things might break unexpectedly. <br>
ToolTip.text: qsTr("Select events to hide in this room") Please take note that it can't be disabled afterwards.")
onClicked: hiddenEventsDialog.show() modality: Qt.NonModal
Layout.alignment: Qt.AlignRight onAccepted: {
} if (roomSettings.isEncryptionEnabled)
return ;
Item { roomSettings.enableEncryption();
// for adding extra space between sections }
Layout.fillWidth: true onRejected: {
} encryptionToggle.checked = false;
}
buttons: Platform.MessageDialog.Ok | Platform.MessageDialog.Cancel
}
Item { Label {
// for adding extra space between sections text: qsTr("Sticker & Emote Settings")
Layout.fillWidth: true }
}
Label { Button {
text: qsTr("INFO") text: qsTr("Change")
font.bold: true ToolTip.text: qsTr("Change what packs are enabled, remove packs or create new ones")
} onClicked: TimelineManager.openImagePackSettings(roomSettings.roomId)
Layout.alignment: Qt.AlignRight
}
Item { Label {
Layout.fillWidth: true text: qsTr("Hidden events")
} }
Label { HiddenEventsDialog {
text: qsTr("Internal ID") id: hiddenEventsDialog
} roomid: roomSettings.roomId
roomName: roomSettings.roomName
}
Label { Button {
text: roomSettings.roomId text: qsTr("Configure")
font.pixelSize: Math.floor(fontMetrics.font.pixelSize * 0.8) ToolTip.text: qsTr("Select events to hide in this room")
Layout.alignment: Qt.AlignRight onClicked: hiddenEventsDialog.show()
} Layout.alignment: Qt.AlignRight
}
Label { Item {
text: qsTr("Room Version") // for adding extra space between sections
} Layout.fillWidth: true
}
Label { Item {
text: roomSettings.roomVersion // for adding extra space between sections
font.pixelSize: fontMetrics.font.pixelSize Layout.fillWidth: true
Layout.alignment: Qt.AlignRight }
}
Label {
text: qsTr("INFO")
font.bold: true
}
Item {
Layout.fillWidth: true
}
Label {
text: qsTr("Internal ID")
}
Label {
text: roomSettings.roomId
font.pixelSize: Math.floor(fontMetrics.font.pixelSize * 0.8)
Layout.alignment: Qt.AlignRight
}
Label {
text: qsTr("Room Version")
}
Label {
text: roomSettings.roomVersion
font.pixelSize: fontMetrics.font.pixelSize
Layout.alignment: Qt.AlignRight
}
}
} }
} }
}
footer: DialogButtonBox { footer: DialogButtonBox {
standardButtons: DialogButtonBox.Ok standardButtons: DialogButtonBox.Ok
onAccepted: close() onAccepted: close()