From 1147e7d717f6b7d4fa05e7a7a5519122615a0030 Mon Sep 17 00:00:00 2001 From: link2xt Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: ComposePane: "attach" button --- qml/ComposePane.qml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'qml/ComposePane.qml') diff --git a/qml/ComposePane.qml b/qml/ComposePane.qml index 2f6145c..6bcdec9 100644 --- a/qml/ComposePane.qml +++ b/qml/ComposePane.qml @@ -2,6 +2,7 @@ import DeltaChat 1.0 import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 +import QtQuick.Dialogs 1.3 Pane { id: root @@ -21,9 +22,35 @@ Pane { padding: 0 + FileDialog { + id: attachFileDialog + title: "Attach" + folder: shortcuts.home + + onAccepted: { + var url = attachFileDialog.fileUrl.toString() + if (url.startsWith("file://")) { + var filename = url.substring(7) + console.log("Attaching " + filename) + } + } + } + RowLayout { width: parent.width + Button { + id: attachButton + visible: root.canSend + text: qsTr("Attach") + + Layout.alignment: Qt.AlignBottom + + icon.name: "mail-attachment" + + onClicked: attachFileDialog.open() + } + TextArea { id: messageField -- cgit v1.2.3-70-g09d2