diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-06-14 14:59:43 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-06-14 15:51:56 +0200 |
commit | 5941fdf6d65ecf29fc46dab000987041f5f4a8d8 (patch) | |
tree | 07a04edf9079955aa725ea24014106dcb6616911 /components | |
parent | 8809ffea6390e593b1d83f69cc50dfe8d7dadad0 (diff) | |
download | kube-5941fdf6d65ecf29fc46dab000987041f5f4a8d8.tar.gz kube-5941fdf6d65ecf29fc46dab000987041f5f4a8d8.zip |
Attachment support in the composer
Diffstat (limited to 'components')
-rw-r--r-- | components/kube/contents/ui/ComposerView.qml | 42 |
1 files changed, 42 insertions, 0 deletions
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 @@ | |||
21 | import QtQuick 2.7 | 21 | import QtQuick 2.7 |
22 | import QtQuick.Controls 1.3 | 22 | import QtQuick.Controls 1.3 |
23 | import QtQuick.Layouts 1.1 | 23 | import QtQuick.Layouts 1.1 |
24 | import QtQuick.Dialogs 1.0 as Dialogs | ||
24 | 25 | ||
25 | import org.kube.framework 1.0 as Kube | 26 | import org.kube.framework 1.0 as Kube |
26 | 27 | ||
@@ -253,6 +254,47 @@ Kube.View { | |||
253 | onActiveFocusChanged: closeFirstSplitIfNecessary() | 254 | onActiveFocusChanged: closeFirstSplitIfNecessary() |
254 | } | 255 | } |
255 | 256 | ||
257 | Row { | ||
258 | Layout.fillWidth: true | ||
259 | spacing: Kube.Units.largeSpacing | ||
260 | Flow { | ||
261 | id: attachments | ||
262 | |||
263 | layoutDirection: Qt.RightToLeft | ||
264 | spacing: Kube.Units.smallSpacing | ||
265 | clip: true | ||
266 | |||
267 | Repeater { | ||
268 | model: composerController.attachmentModel | ||
269 | delegate: Kube.AttachmentDelegate { | ||
270 | name: model.filename | ||
271 | icon: model.iconName | ||
272 | clip: true | ||
273 | } | ||
274 | } | ||
275 | } | ||
276 | Kube.Button { | ||
277 | text: "Attach file" | ||
278 | |||
279 | onClicked: { | ||
280 | fileDialogComponent.createObject(parent) | ||
281 | } | ||
282 | |||
283 | Component { | ||
284 | id: fileDialogComponent | ||
285 | Dialogs.FileDialog { | ||
286 | id: fileDialog | ||
287 | visible: true | ||
288 | title: "Choose a file to attach" | ||
289 | selectFolder: false | ||
290 | onAccepted: { | ||
291 | composerController.addAttachment(fileDialog.fileUrl) | ||
292 | } | ||
293 | } | ||
294 | } | ||
295 | } | ||
296 | } | ||
297 | |||
256 | Kube.TextArea { | 298 | Kube.TextArea { |
257 | id: content | 299 | id: content |
258 | Layout.fillWidth: true | 300 | Layout.fillWidth: true |