Room settings: add room ID text area + copy button
The only way to see a room's ID previously was to right click a room in the left pane, copy option, and paste it somewhere.
This commit is contained in:
parent
1d29e47818
commit
bcb9ffcf9d
|
@ -16,9 +16,11 @@ HButton {
|
|||
toolTip.label.wrapMode: HLabel.NoWrap
|
||||
|
||||
onClicked: {
|
||||
const oldPosition = textControl.cursorPosition
|
||||
textControl.selectAll()
|
||||
textControl.copy()
|
||||
textControl.deselect()
|
||||
textControl.cursorPosition = oldPosition
|
||||
|
||||
toolTip.text = qsTr("Copied!")
|
||||
toolTip.instantShow(2000)
|
||||
|
|
|
@ -17,7 +17,8 @@ HFlickableColumnPage {
|
|||
encryptCheckBox.changed || requireInviteCheckbox.changed ||
|
||||
forbidGuestsCheckBox.changed
|
||||
|
||||
readonly property Item keybindFocusItem: nameField.item
|
||||
readonly property Item keybindFocusItem:
|
||||
nameField.item.enabled ? nameField.item : copyIdButton
|
||||
|
||||
function save() {
|
||||
if (saveFutureId) py.cancelCoro(saveFutureId)
|
||||
|
@ -99,6 +100,31 @@ HFlickableColumnPage {
|
|||
Layout.alignment: Qt.AlignCenter
|
||||
}
|
||||
|
||||
HLabeledItem {
|
||||
label.text: qsTr("Room ID:")
|
||||
Layout.fillWidth: true
|
||||
|
||||
HRowLayout {
|
||||
width: parent.width
|
||||
|
||||
HTextArea {
|
||||
id: idAreaItem
|
||||
wrapMode: HLabel.WrapAnywhere
|
||||
readOnly: true
|
||||
radius: 0
|
||||
text: chat.roomId
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
FieldCopyButton {
|
||||
id: copyIdButton
|
||||
textControl: idAreaItem
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HLabeledItem {
|
||||
id: nameField
|
||||
label.text: qsTr("Name:")
|
||||
|
|
Loading…
Reference in New Issue
Block a user