aboutsummaryrefslogtreecommitdiff
path: root/qml/ComposePane.qml
diff options
context:
space:
mode:
authorlink2xt <link2xt@testrun.org>1970-01-01 00:00:00 +0000
committerlink2xt <link2xt@testrun.org>1970-01-01 00:00:00 +0000
commit1147e7d717f6b7d4fa05e7a7a5519122615a0030 (patch)
tree6e7a51d5b571b2fa430dd94d146fd1b712767ae8 /qml/ComposePane.qml
parent2936a854df9f1a1202fda08cd71773a95c727603 (diff)
downloadkdeltachat-1147e7d717f6b7d4fa05e7a7a5519122615a0030.tar.gz
kdeltachat-1147e7d717f6b7d4fa05e7a7a5519122615a0030.zip
ComposePane: "attach" button
Diffstat (limited to 'qml/ComposePane.qml')
-rw-r--r--qml/ComposePane.qml27
1 files changed, 27 insertions, 0 deletions
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