diff --git a/imports/Spectral/Component/Timeline/MessageDelegate.qml b/imports/Spectral/Component/Timeline/MessageDelegate.qml index db6eea7..650052d 100644 --- a/imports/Spectral/Component/Timeline/MessageDelegate.qml +++ b/imports/Spectral/Component/Timeline/MessageDelegate.qml @@ -72,7 +72,7 @@ RowLayout { MouseArea { anchors.fill: parent cursorShape: Qt.PointingHandCursor - onClicked: inputField.insert(inputField.cursorPosition, author.displayName) + onClicked: roomPanelInput.insert(author.displayName) } } diff --git a/imports/Spectral/Menu/MessageContextMenu.qml b/imports/Spectral/Menu/MessageContextMenu.qml index 277f7bd..0fd0767 100644 --- a/imports/Spectral/Menu/MessageContextMenu.qml +++ b/imports/Spectral/Menu/MessageContextMenu.qml @@ -38,8 +38,8 @@ Menu { text: "Reply" onTriggered: { - inputField.clear() - inputField.insert(0, "> <" + model.author.id + "><" + model.eventId + "> " + (selectedText != "" ? selectedText : model.message) + "\n\n") + roomPanelInput.clear() + roomPanelInput.insert("> <" + model.author.id + "><" + model.eventId + "> " + (selectedText != "" ? selectedText : model.message) + "\n\n") } } MenuItem { diff --git a/imports/Spectral/Panel/RoomListDelegate.qml b/imports/Spectral/Panel/RoomListDelegate.qml index ecabadb..3a1c93c 100644 --- a/imports/Spectral/Panel/RoomListDelegate.qml +++ b/imports/Spectral/Panel/RoomListDelegate.qml @@ -21,11 +21,11 @@ Rectangle { roomContextMenu.popup() } onPrimaryClicked: { + listView.currentIndex = index if (category === RoomType.Invited) { inviteDialog.currentRoom = currentRoom inviteDialog.open() } else { - listView.currentIndex = index enteredRoom = currentRoom } } diff --git a/imports/Spectral/Panel/RoomPanelForm.ui.qml b/imports/Spectral/Panel/RoomPanelForm.ui.qml index 462f14d..185c41e 100644 --- a/imports/Spectral/Panel/RoomPanelForm.ui.qml +++ b/imports/Spectral/Panel/RoomPanelForm.ui.qml @@ -274,6 +274,9 @@ Item { RoomPanelInput { anchors.verticalCenter: parent.top + + id: roomPanelInput + width: parent.width height: 48 } diff --git a/imports/Spectral/Panel/RoomPanelInput.qml b/imports/Spectral/Panel/RoomPanelInput.qml index 41fbb4c..7daec12 100644 --- a/imports/Spectral/Panel/RoomPanelInput.qml +++ b/imports/Spectral/Panel/RoomPanelInput.qml @@ -189,4 +189,12 @@ Rectangle { } } } + + function insert(str) { + inputField.insert(inputField.cursorPosition, str) + } + + function clear() { + inputField.clear() + } }