Fix imageclipboard saveImage().

This commit is contained in:
Black Hat
2019-05-19 22:35:08 +08:00
parent 603cb33042
commit 6bf7e7e0c9
5 changed files with 32 additions and 18 deletions

View File

@@ -125,7 +125,7 @@ Item {
background: RippleEffect {
onClicked: {
var localPath = StandardPaths.writableLocation(StandardPaths.CacheLocation) + "/screenshots/" + (new Date()).getTime() + ".png"
imageClipboard.saveImage(localPath)
if (!imageClipboard.saveImage(localPath)) return
roomPanelInput.attach(localPath)
attachDialog.close()
}

View File

@@ -301,7 +301,7 @@ Control {
Keys.onReturnPressed: {
if (event.modifiers & Qt.ShiftModifier) {
insert(cursorPosition, "\n")
} else if (text) {
} else {
postMessage(text)
text = ""
closeAll()
@@ -353,7 +353,6 @@ Control {
}
function postMessage(text) {
if (text.trim().length === 0) { return }
if(!currentRoom) { return }
if (hasAttachment) {
@@ -362,6 +361,8 @@ Control {
return
}
if (text.trim().length === 0) { return }
var PREFIX_ME = '/me '
var PREFIX_NOTICE = '/notice '
var PREFIX_RAINBOW = '/rainbow '