summaryrefslogtreecommitdiffstats
path: root/components/mail/contents/ui/main.qml
diff options
context:
space:
mode:
Diffstat (limited to 'components/mail/contents/ui/main.qml')
-rw-r--r--components/mail/contents/ui/main.qml201
1 files changed, 201 insertions, 0 deletions
diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml
new file mode 100644
index 00000000..95729954
--- /dev/null
+++ b/components/mail/contents/ui/main.qml
@@ -0,0 +1,201 @@
1/*
2 * Copyright (C) 2015 Michael Bohlender <michael.bohlender@kdemail.net>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18import QtQuick 2.4
19import QtQuick.Controls 1.3
20import QtQuick.Layouts 1.1
21import org.kde.plasma.components 2.0 as PlasmaComponents
22
23import org.kde.kube.actions 1.0 as KubeAction
24import org.kde.kube.settings 1.0 as KubeSettings
25import org.kube.components 1.0 as KubeComponents
26
27ApplicationWindow {
28 id: app
29
30 //FIXME remove fixed pixel hight
31 //for now just convinience during testing
32 height: 1080 * 0.7
33 width: 1920 * 0.7
34
35 visible: true
36
37 // Action.ActionHandler {
38 // actionId: "org.kde.kube.actions.mark-as-read"
39 // function isReady(context) {
40 // return context.mail ? true : false;
41 // }
42 //
43 // function handler(context) {
44 // console.warn("Got message:", context.mail)
45 // }
46 // }
47
48 KubeAction.Context {
49 id: maillistcontext
50 property variant mail
51 mail: mailListView.currentMail
52 }
53
54 KubeAction.Action {
55 id: markAsReadAction
56 actionId: "org.kde.kube.actions.mark-as-read"
57 context: maillistcontext
58 }
59
60 KubeAction.Action {
61 id: deleteAction
62 actionId: "org.kde.kube.actions.delete"
63 context: maillistcontext
64 }
65
66 //UI
67 toolBar: ToolBar {
68
69 Row {
70 anchors.fill: parent
71
72 PlasmaComponents.ToolButton {
73 height: parent.height
74 text: "Settings"
75 onClicked: {
76 settings.visible = true
77 }
78 }
79
80 PlasmaComponents.ToolButton {
81 height: parent.height
82 iconName: "mail-message-new"
83 text: "Compose"
84 onClicked: {
85 composer.visible = true
86 }
87 }
88
89 PlasmaComponents.ToolButton {
90 height: parent.height
91 iconName: "mail-message-reply"
92 text: "Reply"
93 onClicked: {
94 composer.originalMessage = mailListView.currentMail
95 composer.visible = true
96 }
97 }
98
99 PlasmaComponents.ToolButton {
100 height: parent.height
101 iconName: "mail-mark-unread"
102 text: "Mark As Read"
103 enabled: markAsReadAction.ready
104 onClicked: {
105 markAsReadAction.execute()
106 }
107 }
108
109 PlasmaComponents.ToolButton {
110 height: parent.height
111 iconName: "mail-mark-important"
112 text: "Mark Important"
113 enabled: false
114 onClicked: {
115 }
116 }
117
118 PlasmaComponents.ToolButton {
119 height: parent.height
120 iconName: "edit-delete"
121 text: "Delete Mail"
122 enabled: deleteAction.ready
123 onClicked: {
124 deleteAction.execute()
125 }
126 }
127
128
129 }
130 Rectangle {
131 anchors {
132 right: parent.right
133 }
134 height: parent.height
135 color: "transparent"
136 Image {
137 id: img
138 height: parent.height
139 fillMode: Image.PreserveAspectCrop
140 anchors {
141 verticalCenter: parent.verticalCenter
142 left: parent.left
143 leftMargin: -20
144 }
145 source: "image://kube/kube_logo"
146 sourceSize.height: parent.height * 2.5
147 }
148 width: img.width * 0.7
149 }
150 }
151
152 SplitView {
153 anchors.fill: parent
154
155 KubeComponents.FolderListView {
156 id: folderListView
157 width: unit.size * 55
158 Layout.maximumWidth: unit.size * 150
159 Layout.minimumWidth: unit.size * 30
160 }
161
162 KubeComponents.MailListView {
163 id: mailListView
164 parentFolder: folderListView.currentFolder
165 width: unit.size * 80
166 Layout.maximumWidth: unit.size * 250
167 Layout.minimumWidth: unit.size * 50
168 focus: true
169 }
170
171 KubeComponents.SingleMailView {
172 id: mailView
173 mail: mailListView.currentMail
174 Layout.fillWidth: true
175 }
176
177 }
178
179 KubeComponents.Settings {
180 id: settings
181
182 anchors.fill: parent
183 }
184
185 KubeComponents.FocusComposer {
186 id: composer
187
188 anchors.fill: parent
189 }
190
191 //TODO find a better way to scale UI
192 Item {
193 id: unit
194 property int size: 5
195 }
196
197 KubeComponents.ColorPalette {
198 id: colorPalette
199 }
200}
201