Add typing notification.

This commit is contained in:
Black Hat
2018-08-20 22:40:36 +08:00
parent 85c2e54219
commit fa4db065f2
3 changed files with 77 additions and 2 deletions

View File

@@ -319,7 +319,10 @@ Item {
selectByMouse: true
text: currentRoom ? currentRoom.cachedInput : ""
onTextChanged: currentRoom.cachedInput = text
onTextChanged: {
currentRoom.isTyping = true
currentRoom.cachedInput = text
}
Keys.onReturnPressed: {
if (inputField.text) {
@@ -332,6 +335,9 @@ Item {
color: Material.theme == Material.Light ? "#eaeaea" : "#242424"
}
ToolTip.visible: currentRoom && currentRoom.hasUsersTyping
ToolTip.text: currentRoom ? currentRoom.usersTyping : ""
function postMessage(text) {
if (text.trim().length === 0) { return }
if(!currentRoom) { return }