From 5941fdf6d65ecf29fc46dab000987041f5f4a8d8 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 14 Jun 2017 14:59:43 +0200 Subject: Attachment support in the composer --- components/kube/contents/ui/ComposerView.qml | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'components') diff --git a/components/kube/contents/ui/ComposerView.qml b/components/kube/contents/ui/ComposerView.qml index 49a59024..9e48aba3 100644 --- a/components/kube/contents/ui/ComposerView.qml +++ b/components/kube/contents/ui/ComposerView.qml @@ -21,6 +21,7 @@ import QtQuick 2.7 import QtQuick.Controls 1.3 import QtQuick.Layouts 1.1 +import QtQuick.Dialogs 1.0 as Dialogs import org.kube.framework 1.0 as Kube @@ -253,6 +254,47 @@ Kube.View { onActiveFocusChanged: closeFirstSplitIfNecessary() } + Row { + Layout.fillWidth: true + spacing: Kube.Units.largeSpacing + Flow { + id: attachments + + layoutDirection: Qt.RightToLeft + spacing: Kube.Units.smallSpacing + clip: true + + Repeater { + model: composerController.attachmentModel + delegate: Kube.AttachmentDelegate { + name: model.filename + icon: model.iconName + clip: true + } + } + } + Kube.Button { + text: "Attach file" + + onClicked: { + fileDialogComponent.createObject(parent) + } + + Component { + id: fileDialogComponent + Dialogs.FileDialog { + id: fileDialog + visible: true + title: "Choose a file to attach" + selectFolder: false + onAccepted: { + composerController.addAttachment(fileDialog.fileUrl) + } + } + } + } + } + Kube.TextArea { id: content Layout.fillWidth: true -- cgit v1.2.3