Dekko
Loading...
Searching...
No Matches
Composer.qml
1import QtQuick 2.4
2import QtQuick.Controls.Suru 2.2
3import Lomiri.Components 1.3
4import Lomiri.Components.Popups 1.3
5import Dekko.Components 1.0
6import Dekko.Mail 1.0
7import Dekko.Mail.API 1.0
8import Dekko.Mail.Stores.Composer 1.0
9import QuickFlux 1.0
10import PlugMan 1.0
11import Dekko.Lomiri.Components 1.0
12import Dekko.Lomiri.Constants 1.0
13import Dekko.Lomiri.Helpers 1.0
14import "../components"
15
17 id: composer
18 anchors.fill: parent
19
20 StretchColumn {
21 anchors.fill: parent
22
23 Rectangle {
24 anchors {
25 top: parent.top
26 right: parent.right
27 left: parent.left
28 }
29 height: units.gu(6)
30 implicitHeight: height
31 color: Suru.secondaryBackgroundColor
32 StretchRow {
33 id: row
34 anchors.fill: parent
35 anchors.leftMargin: units.gu(1)
36 anchors.rightMargin: units.gu(1)
37 spacing: units.gu(1)
38 readonly property bool textVisible: composer.width > units.gu(60)
40 height: units.gu(4)
41 anchors.verticalCenter: parent.verticalCenter
42 action: ComposerStore.actions.discardMessageAction
43 showLabel: row.textVisible
44 }
46 height: units.gu(4)
47 anchors.verticalCenter: parent.verticalCenter
48 visible: ComposerStore.hasValidIdentity
49 action: ComposerStore.actions.saveDraftAction
50 showLabel: row.textVisible
51 }
52
54 height: units.gu(4)
55 anchors.verticalCenter: parent.verticalCenter
56 action: Action {
57 text: qsTr("Attach")
58 iconName: Icons.AttachmentIcon
59 iconSource: Paths.actionIconUrl(Icons.AttachmentIcon)
60 onTriggered: ContentActions.pickFile(composer)
61 }
62 showLabel: row.textVisible
63 }
64
66 height: units.gu(4)
67 anchors.verticalCenter: parent.verticalCenter
68 action: Action {
69 text: qsTr("Contacts")
70 iconName: "contact"
71 onTriggered: PopupUtils.open(Qt.resolvedUrl("./ComposerOverflowMenu.qml"), composer)
72 }
73 showLabel: row.textVisible
74 }
75
77 height: units.gu(4)
78 anchors.verticalCenter: parent.verticalCenter
79 action: ComposerStore.actions.toggleComposeModeAction
80 showLabel: row.textVisible
81 }
82
83 Stretcher {}
84
86 height: units.gu(4)
87 anchors.verticalCenter: parent.verticalCenter
88 visible: ComposerStore.hasValidIdentity
89 action: ComposerStore.actions.sendAction
90 showLabel: row.textVisible
91 }
92 }
93
94 Line {
95 anchors {
96 bottom: parent.bottom
97 right: parent.right
98 left: parent.left
99 }
100 }
101 }
102
103 Stretcher {
104 id: content
105
106 StretchRow {
107 anchors.fill: parent
108 spacing: 0
109
110 Stretcher {
111 implicitHeight: parent.height - attachmentPanel.height
112 MessageComposer {
113 id: composePanel
114 anchors.fill: parent
115 }
116 }
117
119 id: attachmentPanel
120 attachments: ComposerStore.attachments
121 isReadOnly: false
122 anchors {
123 left: parent.left
124 bottom: parent.bottom
125 right: parent.right
126 }
127 maxHeight: parent.height / 2
128 }
129 }
130 }
131 }
132}