diff --git a/imports/Spectral/Panel/RoomPanelInput.qml b/imports/Spectral/Panel/RoomPanelInput.qml index 693029030..cae34ff9e 100644 --- a/imports/Spectral/Panel/RoomPanelInput.qml +++ b/imports/Spectral/Panel/RoomPanelInput.qml @@ -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) }