expose options better

This commit is contained in:
Malte E 2022-03-27 22:32:29 +02:00
parent af17e4f8c0
commit d7cb2bd647
2 changed files with 67 additions and 16 deletions

View file

@ -19,6 +19,10 @@ ApplicationWindow {
minimumHeight: layout.implicitHeight+2*layout.anchors.margins+footer.height minimumHeight: layout.implicitHeight+2*layout.anchors.margins+footer.height
minimumWidth: footer.width minimumWidth: footer.width
Shortcut {
sequence: StandardKey.Cancel
onActivated: roomDirectoryWindow.close()
}
DelegateModel { DelegateModel {
id: dMod id: dMod
model: profile? profile.deviceList : undefined model: profile? profile.deviceList : undefined

View file

@ -15,6 +15,10 @@ ApplicationWindow {
title: qsTr("Create Room") title: qsTr("Create Room")
minimumWidth: rootLayout.implicitWidth+2*rootLayout.anchors.margins minimumWidth: rootLayout.implicitWidth+2*rootLayout.anchors.margins
minimumHeight: rootLayout.implicitHeight+footer.implicitHeight+2*rootLayout.anchors.margins minimumHeight: rootLayout.implicitHeight+footer.implicitHeight+2*rootLayout.anchors.margins
Shortcut {
sequence: StandardKey.Cancel
onActivated: createRoomRoot.close()
}
GridLayout { GridLayout {
id: rootLayout id: rootLayout
anchors.fill: parent anchors.fill: parent
@ -36,43 +40,86 @@ ApplicationWindow {
focus: true focus: true
placeholderText: qsTr("Topic") placeholderText: qsTr("Topic")
} }
MatrixTextField { RowLayout {
id: newRoomAlias
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
Label {
focus: true Layout.preferredWidth: implicitWidth
placeholderText: qsTr("Alias") text: qsTr("#")
color: Nheko.colors.text
}
MatrixTextField {
id: newRoomAlias
focus: true
placeholderText: qsTr("Alias")
}
Label {
Layout.preferredWidth: implicitWidth
property string userName: userInfoGrid.profile.userid
text: userName.substring(userName.indexOf(":"))
color: Nheko.colors.text
}
} }
Label { Label {
Layout.preferredWidth: implicitWidth Layout.preferredWidth: implicitWidth
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
text: qsTr("Room Visibility") text: qsTr("Private")
color: Nheko.colors.text color: Nheko.colors.text
HoverHandler {
id: privateHover
}
ToolTip.visible: privateHover.hovered
ToolTip.text: qsTr("Only invited users can join the room")
ToolTip.delay: Nheko.tooltipDelay
} }
ComboBox { ToggleButton {
id: newRoomVisibility
Layout.preferredWidth: implicitWidth
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
model: [qsTr("Private"), qsTr("Public")] Layout.preferredWidth: implicitWidth
id: isPrivate
checked: true
} }
Label { Label {
Layout.preferredWidth: implicitWidth Layout.preferredWidth: implicitWidth
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
text: qsTr("Room Preset") text: qsTr("Trusted")
color: Nheko.colors.text color: Nheko.colors.text
HoverHandler {
id: trustedHover
}
ToolTip.visible: trustedHover.hovered
ToolTip.text: qsTr("All invitees are given the same power level as the creator")
ToolTip.delay: Nheko.tooltipDelay
} }
ComboBox { ToggleButton {
id: newRoomPreset
Layout.preferredWidth: implicitWidth
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
model: [qsTr("Private Chat"), qsTr("Public Chat"), qsTr("Trusted Private Chat")] Layout.preferredWidth: implicitWidth
id: isTrusted
checked: false
enabled: isPrivate.checked
}
Label {
Layout.preferredWidth: implicitWidth
Layout.alignment: Qt.AlignLeft
text: qsTr("Encryption")
color: Nheko.colors.text
HoverHandler {
id: encryptionHover
}
ToolTip.visible: encryptionHover.hovered
ToolTip.text: qsTr("Caution: Encryption cannot be disabled")
ToolTip.delay: Nheko.tooltipDelay
}
ToggleButton {
Layout.alignment: Qt.AlignRight
Layout.preferredWidth: implicitWidth
id: isEncrypted
checked: false
} }
} }
footer: DialogButtonBox { footer: DialogButtonBox {
standardButtons: DialogButtonBox.Cancel standardButtons: DialogButtonBox.Cancel
Button { Button {
text: "Create Room" text: qsTr("Create Room")
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
} }
onRejected: createRoomRoot.close(); onRejected: createRoomRoot.close();