summaryrefslogtreecommitdiffstats
path: root/components/package/contents/ui/FocusComposer.qml
diff options
context:
space:
mode:
Diffstat (limited to 'components/package/contents/ui/FocusComposer.qml')
-rw-r--r--components/package/contents/ui/FocusComposer.qml254
1 files changed, 227 insertions, 27 deletions
diff --git a/components/package/contents/ui/FocusComposer.qml b/components/package/contents/ui/FocusComposer.qml
index 9129dba9..c22983f5 100644
--- a/components/package/contents/ui/FocusComposer.qml
+++ b/components/package/contents/ui/FocusComposer.qml
@@ -17,25 +17,48 @@
17*/ 17*/
18 18
19import QtQuick 2.4 19import QtQuick 2.4
20import QtQuick.Controls 1.4
21import QtQuick.Layouts 1.1 20import QtQuick.Layouts 1.1
21import QtQuick.Controls 1.4 as Controls
22import QtQuick.Controls 2.0 as Controls2
22 23
23import org.kde.kirigami 1.0 as Kirigami 24import org.kde.kirigami 1.0 as Kirigami
24 25
25import org.kube.components 1.0 as KubeComponents 26import org.kube.framework.domain 1.0 as KubeFramework
26 27
27KubeComponents.OverlayDialog { 28Controls2.Popup {
28 id: root 29 id: root
29 30
31 //Controler
32 KubeFramework.ComposerController {
33 id: composer
34 }
35
36 //BEGIN functions
30 function loadMessage(message, loadAsDraft) { 37 function loadMessage(message, loadAsDraft) {
31 composer.loadMessage(message, loadAsDraft); 38 composer.loadMessage(message, loadAsDraft)
39 }
40
41 function send() {
42 composer.send()
43 }
44
45 function saveAsDraft() {
46 composer.saveAsDraft()
32 } 47 }
33 48
49 function clear() {
50 composer.clear();
51 }
52 //END functions
53
54 modal: true
55 focus: true
56 closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
57
34 Item { 58 Item {
35 anchors.centerIn: parent
36 59
37 height: root.height * 0.8 60 height: parent.height
38 width: root.width * 0.8 61 width: parent.width
39 62
40 ColumnLayout { 63 ColumnLayout {
41 64
@@ -44,45 +67,222 @@ KubeComponents.OverlayDialog {
44 margins: Kirigami.Units.largeSpacing 67 margins: Kirigami.Units.largeSpacing
45 } 68 }
46 69
47 Composer { 70 ColumnLayout {
48 id: composer
49 71
50 Layout.fillWidth: true 72 anchors.fill: parent
51 Layout.fillHeight: true 73
52 } 74 Controls.TextField {
75 id: subject
53 76
54 RowLayout { 77 Layout.fillWidth: true
55 78
56 Button { 79 placeholderText: "Enter Subject..."
57 80
58 text: "Discard" 81 text: composer.subject
59 82
60 onClicked: { 83 onTextChanged: {
61 root.destroy() 84 composer.subject = text;
85 }
86 }
87
88 GridLayout {
89
90 columns: 2
91
92 Kirigami.Label {
93 text: "To"
94 }
95
96 RowLayout {
97 Layout.fillWidth: true
98
99 Controls.TextField {
100 id: to
101
102 Layout.fillWidth: true
103
104 text: composer.to
105
106 onTextChanged: {
107 composer.to = text;
108 }
109 }
110 }
111
112 Kirigami.Label {
113 text: "Cc"
114
115 visible: cc.visible
116 }
117
118 Controls.TextField {
119 id: cc
120
121 Layout.fillWidth: true
122
123 visible: false
124
125 text: composer.cc
126
127 onTextChanged: {
128 composer.cc = text;
129 }
130 }
131
132 Kirigami.Label {
133 text: "Bcc"
134
135 visible: bcc.visible
136 }
137
138 Controls.TextField {
139 id: bcc
140
141 Layout.fillWidth: true
142
143 visible : false
144
145 text: composer.bcc
146
147 onTextChanged: {
148 composer.bcc = text;
149 }
150 }
151 }
152
153 RowLayout {
154 Kirigami.Label {
155 text: "Sending as"
156 }
157
158 Controls.ComboBox {
159 id: identityCombo
160 model: composer.identityModel
161 textRole: "displayName"
162
163 Layout.fillWidth: true
164
165 onCurrentIndexChanged: {
166 composer.currentIdentityIndex = currentIndex
167 }
168 }
169
170 Controls.Button {
171 id: ccButton
172
173 text: "Cc"
174
175 onClicked: {
176 cc.visible = true
177 ccButton.visible = false
178 }
179 }
180
181 Controls.Button {
182 id: bccButton
183
184 text: "Bcc"
185
186 onClicked: {
187 bcc.visible = true
188 bccButton.visible = false
189 }
62 } 190 }
63 } 191 }
64 192
65 Item { 193 Item {
194
66 Layout.fillWidth: true 195 Layout.fillWidth: true
196
197 height: subject.height * 1.5
198
199 Controls.Button {
200
201 anchors {
202 bottom: parent.bottom
203 right: parent.right
204 }
205
206 text: "Attach"
207
208 onClicked: {
209 fileDialog.open();
210 }
211 }
67 } 212 }
68 213
214 RowLayout {
215
216 Layout.fillWidth: true
217
218 Repeater {
219
220 model: composer.attachments
69 221
70 Button { 222 delegate: Kirigami.Label {
223 id: name
71 224
72 text: "Save as Draft" 225 text: modelData
73 226
74 onClicked: { 227 Rectangle {
75 composer.saveAsDraft() 228
76 root.destroy() 229 anchors.fill: parent
230
231 color: "lightsteelblue"
232 }
233 }
77 } 234 }
78 } 235 }
79 236
80 Button { 237 Controls.TextArea {
81 text: "Send" 238 id: content
239
240 text: composer.body
241
242 onTextChanged: {
243 composer.body = text;
244 }
245
246 Layout.fillWidth: true
247 Layout.fillHeight: true
248 }
249
250 RowLayout {
251 id: bottomBar
252
253 width: parent.width
254
255 Controls.Button {
256
257 text: "Discard"
258
259 onClicked: {
260 root.close()
261 }
262 }
263
264 Item {
265 Layout.fillWidth: true
266 }
267
268
269 Controls.Button {
270
271 text: "Save as Draft"
272
273 onClicked: {
274 saveAsDraft()
275 root.close()
276 }
277 }
278
279 Controls.Button {
280 text: "Send"
82 281
83 onClicked: { 282 onClicked: {
84 composer.send() 283 send()
85 root.destroy() 284 root.close()
285 }
86 } 286 }
87 } 287 }
88 } 288 }