Only show option to upload image from clipboard when there is image in

clipboard.
This commit is contained in:
Black Hat
2019-06-23 15:11:22 +08:00
parent 18ebd57e5a
commit df09d1b2ef

View File

@@ -181,7 +181,21 @@ Control {
icon: "\ue226"
}
onClicked: attachDialog.open()
onClicked: {
if (imageClipboard.hasImage) {
attachDialog.open()
} else {
var fileDialog = openFileDialog.createObject(ApplicationWindow.overlay)
fileDialog.chosen.connect(function(path) {
if (!path) return
roomPanelInput.attach(path)
})
fileDialog.open()
}
}
BusyIndicator {
anchors.fill: parent
@@ -428,10 +442,6 @@ Control {
}
}
ImageClipboard {
id: imageClipboard
}
function insert(str) {
inputField.insert(inputField.cursorPosition, str)
}