Fix some input field issue.

This commit is contained in:
Black Hat 2018-10-17 10:52:00 +08:00
parent b30d92a516
commit 4cc2d443c7
5 changed files with 15 additions and 4 deletions

View File

@ -72,7 +72,7 @@ RowLayout {
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: inputField.insert(inputField.cursorPosition, author.displayName)
onClicked: roomPanelInput.insert(author.displayName)
}
}

View File

@ -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 {

View File

@ -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
}
}

View File

@ -274,6 +274,9 @@ Item {
RoomPanelInput {
anchors.verticalCenter: parent.top
id: roomPanelInput
width: parent.width
height: 48
}

View File

@ -189,4 +189,12 @@ Rectangle {
}
}
}
function insert(str) {
inputField.insert(inputField.cursorPosition, str)
}
function clear() {
inputField.clear()
}
}