Support pasting image to upload in the composer

This commit is contained in:
miruka
2020-07-15 15:10:34 -04:00
parent 2449fd5f18
commit 2d623118b5
6 changed files with 93 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
import QtQuick 2.12
import Clipboard 0.1
import "../../.."
import "../../../Base"
@@ -93,6 +94,7 @@ HTextArea {
enabled: chat.roomInfo.can_send_messages
disabledText: qsTr("You do not have permission to post in this room")
placeholderText: qsTr("Type a message...")
enableCustomImagePaste: true
backgroundColor: "transparent"
focusedBorderColor: "transparent"
@@ -159,6 +161,10 @@ HTextArea {
}
}
onCustomImagePaste: py.callClientCoro(
writingUserId, "send_clipboard_image", [chat.roomId, Clipboard.image],
)
Keys.onEscapePressed: clearReplyTo()
Keys.onReturnPressed: ev => {