summaryrefslogtreecommitdiffstats
path: root/applications/kube-mail
diff options
context:
space:
mode:
Diffstat (limited to 'applications/kube-mail')
-rw-r--r--applications/kube-mail/CMakeLists.txt33
-rw-r--r--applications/kube-mail/main.cpp14
-rw-r--r--applications/kube-mail/package/contents/ui/Avatar.qml55
-rw-r--r--applications/kube-mail/package/contents/ui/ColorPalette.qml26
-rw-r--r--applications/kube-mail/package/contents/ui/FolderListView.qml102
-rw-r--r--applications/kube-mail/package/contents/ui/FolderModel.qml36
-rw-r--r--applications/kube-mail/package/contents/ui/ListItem.qml63
-rw-r--r--applications/kube-mail/package/contents/ui/MailListModel.qml149
-rw-r--r--applications/kube-mail/package/contents/ui/MailListView.qml131
-rw-r--r--applications/kube-mail/package/contents/ui/SingleMailView.qml64
-rw-r--r--applications/kube-mail/package/contents/ui/example.qml64
-rw-r--r--applications/kube-mail/package/contents/ui/main.qml138
-rw-r--r--applications/kube-mail/package/metadata.desktop8
13 files changed, 883 insertions, 0 deletions
diff --git a/applications/kube-mail/CMakeLists.txt b/applications/kube-mail/CMakeLists.txt
new file mode 100644
index 00000000..05c98d18
--- /dev/null
+++ b/applications/kube-mail/CMakeLists.txt
@@ -0,0 +1,33 @@
1project(kube-mail)
2
3cmake_minimum_required(VERSION 2.8.10.1)
4
5include(CPack)
6include(FeatureSummary)
7find_package(PkgConfig)
8
9################# set KDE specific information #################
10
11find_package(ECM 0.0.8 REQUIRED NO_MODULE)
12
13# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
14set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
15
16include(KDEInstallDirs)
17include(KDECMakeSettings)
18include(KDECompilerSettings)
19
20find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui)
21
22set (QT_MIN_VERSION "5.4.0")
23find_package(KF5 REQUIRED COMPONENTS Package)
24
25# install UI package
26kpackage_install_package(package org.kde.kube.mail pim)
27
28# install executable
29add_executable(${PROJECT_NAME} main.cpp)
30qt5_use_modules(${PROJECT_NAME} Gui Quick)
31target_link_libraries(${PROJECT_NAME} KF5::Package)
32
33install(TARGETS ${PROJECT_NAME} DESTINATION bin)
diff --git a/applications/kube-mail/main.cpp b/applications/kube-mail/main.cpp
new file mode 100644
index 00000000..400cba82
--- /dev/null
+++ b/applications/kube-mail/main.cpp
@@ -0,0 +1,14 @@
1#include <QGuiApplication>
2#include <QQmlApplicationEngine>
3
4#include <QStandardPaths>
5
6#include <QDebug>
7
8int main(int argc, char *argv[])
9{
10 QGuiApplication app(argc, argv);
11 auto mainFile = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kpackage/pim/org.kde.kube.mail/contents/ui/main.qml", QStandardPaths::LocateFile);
12 QQmlApplicationEngine engine(QUrl::fromLocalFile(mainFile));
13 return app.exec();
14}
diff --git a/applications/kube-mail/package/contents/ui/Avatar.qml b/applications/kube-mail/package/contents/ui/Avatar.qml
new file mode 100644
index 00000000..33d6733c
--- /dev/null
+++ b/applications/kube-mail/package/contents/ui/Avatar.qml
@@ -0,0 +1,55 @@
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
21
22
23Rectangle {
24
25 property string name;
26
27 //colors taken from https://techbase.kde.org/Projects/Usability/HIG/Color
28 function calcColor(x)
29 {
30 switch (x % 5) {
31 case 0:
32 return "#16a085"
33 case 1:
34 return "#27ae60"
35 case 2:
36 return "#2980b9"
37 case 3:
38 return "#8e44ad"
39 case 4:
40 return "#c0392b"
41 }
42 }
43
44 radius: 2
45
46 color: calcColor(name.length)
47
48 Text {
49 anchors.centerIn: parent
50
51 text: name.charAt(0)
52
53 color: "#ecf0f1"
54 }
55}
diff --git a/applications/kube-mail/package/contents/ui/ColorPalette.qml b/applications/kube-mail/package/contents/ui/ColorPalette.qml
new file mode 100644
index 00000000..db85cac6
--- /dev/null
+++ b/applications/kube-mail/package/contents/ui/ColorPalette.qml
@@ -0,0 +1,26 @@
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
19
20//TODO probably expose it from the Cpp side
21Item {
22 property string background: "#fcfcfc"
23 property string selected: "#3daee9"
24 property string read: "#232629"
25 property string border: "#232629"
26} \ No newline at end of file
diff --git a/applications/kube-mail/package/contents/ui/FolderListView.qml b/applications/kube-mail/package/contents/ui/FolderListView.qml
new file mode 100644
index 00000000..f0ce7da2
--- /dev/null
+++ b/applications/kube-mail/package/contents/ui/FolderListView.qml
@@ -0,0 +1,102 @@
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
21
22import org.kde.plasma.core 2.0 as PlasmaCore
23import org.kde.plasma.components 2.0 as PlasmaComponents
24
25import org.kde.akonadi2.mail 1.0 as Mail
26
27Item {
28 id: root
29
30 Item {
31 id: searchBox
32
33 width: root.width
34 height: unit.size * 10
35
36 TextField {
37 anchors. centerIn: parent
38
39 width: parent.width * 0.9
40
41 placeholderText: "Search all email..."
42 }
43 }
44
45 ScrollView {
46
47 anchors {
48 top: searchBox.bottom
49 left: parent.left
50 right: parent.right
51 bottom: parent.bottom
52 }
53
54 ListView {
55 id: listView
56
57 currentIndex: -1
58
59 clip: true
60
61 model: folderList.model //FolderModel {}
62
63 delegate: PlasmaComponents.ListItem {
64
65 width: root.width
66 height: unit.size * 10
67
68 enabled: true
69 checked: listView.currentIndex == index
70
71 onClicked: {
72 mailList.loadMailFolder(model.id)
73 listView.currentIndex = model.index
74 }
75
76 PlasmaCore.IconItem {
77 id: iconItem
78
79 anchors {
80 verticalCenter: parent.verticalCenter
81 left: parent.left
82 leftMargin: unit.size * 3
83 }
84
85 source: model.icon
86 }
87
88 Label {
89 id: label
90
91 anchors {
92 verticalCenter: parent.verticalCenter
93 left: iconItem.right
94 leftMargin: unit.size * 3
95 }
96
97 text: model.name
98 }
99 }
100 }
101 }
102} \ No newline at end of file
diff --git a/applications/kube-mail/package/contents/ui/FolderModel.qml b/applications/kube-mail/package/contents/ui/FolderModel.qml
new file mode 100644
index 00000000..b20a1606
--- /dev/null
+++ b/applications/kube-mail/package/contents/ui/FolderModel.qml
@@ -0,0 +1,36 @@
1import QtQuick 2.4
2
3ListModel {
4 ListElement {
5 icon: "mail-folder-inbox"
6 name: "Inbox"
7 }
8 ListElement {
9 icon: "mail-folder-sent"
10 name: "Sent"
11 }
12 ListElement {
13 icon: "user-trash"
14 name: "Trash"
15 }
16 ListElement {
17 icon: "document-edit"
18 name: "Drafts"
19 }
20 ListElement {
21 icon: "folder"
22 name: "cats"
23 }
24 ListElement {
25 icon: "folder"
26 name: "dogs"
27 }
28 ListElement {
29 icon: "folder"
30 name: "dragons"
31 }
32 ListElement {
33 icon: "folder"
34 name: "long tailed dragons"
35 }
36} \ No newline at end of file
diff --git a/applications/kube-mail/package/contents/ui/ListItem.qml b/applications/kube-mail/package/contents/ui/ListItem.qml
new file mode 100644
index 00000000..5396645d
--- /dev/null
+++ b/applications/kube-mail/package/contents/ui/ListItem.qml
@@ -0,0 +1,63 @@
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
19
20Item {
21 id: delegateRoot
22
23 readonly property bool isCurrentItem: ListView.isCurrentItem
24
25 height: unit.width * 25
26 width: parent.width
27
28 MouseArea {
29 id: mouseArea
30
31 anchors.fill: parent
32 }
33
34 Rectangle {
35 anchors.fill: parent
36
37 color: colorPalette.background
38
39 //clickColor
40 Rectangle {
41 id: clickColor
42
43 anchors.fill: parent
44
45 color: colorPalette.selected
46 opacity: 0.4
47
48 visible: mouseArea.pressed
49 }
50
51 //border
52 Rectangle {
53
54 anchors.bottom: parent.bottom
55
56 height: 1
57 width: parent.width
58
59 color: colorPalette.border
60 opacity: 0.2
61 }
62 }
63} \ No newline at end of file
diff --git a/applications/kube-mail/package/contents/ui/MailListModel.qml b/applications/kube-mail/package/contents/ui/MailListModel.qml
new file mode 100644
index 00000000..bf0f70a2
--- /dev/null
+++ b/applications/kube-mail/package/contents/ui/MailListModel.qml
@@ -0,0 +1,149 @@
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
19
20ListModel {
21 ListElement {
22 sender: "mighty@mail.com"
23 senderName: "Mighty Monkey"
24 subject: "I feel weak without my bananas"
25 date: "19:21"
26 unread: true
27 }
28 ListElement {
29 sender: "benni@bandana.org"
30 senderName: "Ben Bandana"
31 subject: "Check this out"
32 date: "16:01"
33 unread: true
34 }
35 ListElement {
36 sender: "alice@mail.com"
37 senderName: "Alice Cheng"
38 subject: "Re: We need more food"
39 date: "12:55"
40 unread: false
41 }
42 ListElement {
43 sender: "bob@bandana.org"
44 senderName: "Bob Ross"
45 subject: "KDE Rocks"
46 date: "Sat"
47 unread: true
48 }
49 ListElement {
50 sender: "tiny@mail.com"
51 senderName: "Tiny"
52 subject: "Huge success!!"
53 date: "Sat"
54 unread: false
55 }
56 ListElement {
57 sender: "bob@bandana.org"
58 senderName: "Bob Ross"
59 subject: "KDE Rocks"
60 date: "Fr"
61 unread: false
62 }
63 ListElement {
64 sender: "Laura@mail.com"
65 senderName: "Laura B"
66 subject: ":)"
67 date: "Thu"
68 unread: false
69 }
70 ListElement {
71 sender: "Andreas@stars.org"
72 senderName: "Andreas Rockstar"
73 subject: "KDE Rocks"
74 date: "Wed"
75 unread: false
76 }
77 ListElement {
78 sender: "alice@mail.com"
79 senderName: "Alice Cheng"
80 subject: "Re: We need more food"
81 date: "Wed"
82 }
83 ListElement {
84 sender: "bob@bandana.org"
85 senderName: "Bob Ross"
86 subject: "KDE Rocks"
87 date: "Mon"
88 }
89 ListElement {
90 sender: "mighty@mail.com"
91 senderName: "Mighty Monkey"
92 subject: "I feel weak without my bananas"
93 date: "Nov 20"
94 }
95 ListElement {
96 sender: "benni@bandana.org"
97 senderName: "Ben Bandana"
98 subject: "Check this out"
99 date: "Nov 15"
100 }
101 ListElement {
102 sender: "alice@mail.com"
103 senderName: "Alice Cheng"
104 subject: "Re: We need more food"
105 date: "Sep 29"
106 }
107 ListElement {
108 sender: "bob@bandana.org"
109 senderName: "Bob Ross"
110 subject: "KDE Rocks"
111 date: "Sep 14"
112 }
113 ListElement {
114 sender: "tiny@mail.com"
115 senderName: "Tiny"
116 subject: "Huge success!!"
117 date: "Sep 14"
118 }
119 ListElement {
120 sender: "bob@bandana.org"
121 senderName: "Bob Ross"
122 subject: "KDE Rocks"
123 date: "Sep 5"
124 }
125 ListElement {
126 sender: "Laura@mail.com"
127 senderName: "Laura B"
128 subject: ":)"
129 date: "Sep 4"
130 }
131 ListElement {
132 sender: "Andreas@stars.org"
133 senderName: "Andreas Rockstar"
134 subject: "KDE Rocks"
135 date: "May 25"
136 }
137 ListElement {
138 sender: "alice@mail.com"
139 senderName: "Alice Cheng"
140 subject: "Re: We need more food"
141 date: "May 3"
142 }
143 ListElement {
144 sender: "bob@bandana.org"
145 senderName: "Bob Ross"
146 subject: "Board Task: Write draft email to people with KDE accounts commiting to Qt repositories"
147 date: "Dec 2014"
148 }
149} \ No newline at end of file
diff --git a/applications/kube-mail/package/contents/ui/MailListView.qml b/applications/kube-mail/package/contents/ui/MailListView.qml
new file mode 100644
index 00000000..f6ded917
--- /dev/null
+++ b/applications/kube-mail/package/contents/ui/MailListView.qml
@@ -0,0 +1,131 @@
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
21
22import org.kde.plasma.components 2.0 as PlasmaComponents
23
24ScrollView {
25 id: root
26 ListView {
27 id: listView
28
29 model: mailList.model //MailListModel {}
30
31 delegate: PlasmaComponents.ListItem {
32
33 width: listView.width
34 height: unit.size * 12
35
36 enabled: true
37 checked: listView.currentIndex == index
38
39 MouseArea {
40 anchors.fill: parent
41
42 onClicked: {
43 listView.currentIndex = model.index
44 singleMail.loadMail(model.id)
45 }
46 }
47
48 Rectangle {
49 id: unread
50
51 anchors.fill: parent
52
53 color: colorPalette.read
54 opacity: 0.1
55
56 visible: model.unread == false
57 }
58
59 Avatar {
60 id: avatar
61
62 anchors {
63 verticalCenter: parent.verticalCenter
64 left: parent.left
65 leftMargin: unit.size * 2
66 }
67
68 height: unit.size * 9
69 width: height
70
71 name: model.senderName
72 }
73
74 Label {
75 id: senderName
76
77 anchors {
78 top: avatar.top
79 left: avatar.right
80 leftMargin: unit.size * 3
81 }
82
83 text: model.senderName
84
85 font.weight: Font.DemiBold
86 }
87
88 Label {
89 id: sender
90
91 anchors {
92 top: avatar.top
93 left: senderName.right
94 leftMargin: unit.size
95 right: date.left
96 rightMargin: unit.size
97 }
98
99 text: "(" + model.sender +")"
100
101 clip: true
102 }
103
104 Label {
105 id: date
106
107 anchors {
108 top: avatar.top
109 right: parent.right
110 rightMargin: unit.size * 2
111 }
112
113 text: model.date
114
115 font.weight: Font.Light
116 }
117
118 Label {
119 id: subject
120
121 anchors {
122 bottom: avatar.bottom
123 left: avatar.right
124 leftMargin: unit.size * 3
125 }
126
127 text: model.subject
128 }
129 }
130 }
131} \ No newline at end of file
diff --git a/applications/kube-mail/package/contents/ui/SingleMailView.qml b/applications/kube-mail/package/contents/ui/SingleMailView.qml
new file mode 100644
index 00000000..e307ccfd
--- /dev/null
+++ b/applications/kube-mail/package/contents/ui/SingleMailView.qml
@@ -0,0 +1,64 @@
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
21
22Item {
23 id: root
24
25 Rectangle {
26 id: background
27
28 anchors.fill: parent
29
30 color: colorPalette.background
31 }
32
33 Repeater {
34 anchors.fill: parent
35
36 model: singleMail.model
37
38 delegate: Item {
39 height: root.height
40 width: root.widht
41
42 ColumnLayout {
43
44 Label {
45 text: model.id
46 }
47 Label {
48 text: model.sender
49 }
50 Label {
51 text: model.senderName
52 }
53
54 Label {
55 text: model.subject
56 }
57
58 Label {
59 text: model.mimeMessage
60 }
61 }
62 }
63 }
64} \ No newline at end of file
diff --git a/applications/kube-mail/package/contents/ui/example.qml b/applications/kube-mail/package/contents/ui/example.qml
new file mode 100644
index 00000000..a968bc72
--- /dev/null
+++ b/applications/kube-mail/package/contents/ui/example.qml
@@ -0,0 +1,64 @@
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
21
22import org.kde.akonadi2.mail 1.0
23
24Item {
25 id: root
26
27 MailList {
28 id: mailList
29
30 query: "Some Query"
31
32 }
33
34 Button {
35 id: button
36
37 anchors {
38 top: parent.top
39 right: parent.right
40 left: parent.left
41 }
42
43 text: "add mail"
44
45 onClicked: mailList.addMail("test test test");
46 }
47
48 ListView {
49
50 anchors {
51 top: button.bottom
52 left: parent.left
53 right: parent.right
54 bottom: parent.bottom
55 }
56
57 model: mailList.model
58
59 delegate: Label {
60
61 text: model.subject
62 }
63 }
64} \ No newline at end of file
diff --git a/applications/kube-mail/package/contents/ui/main.qml b/applications/kube-mail/package/contents/ui/main.qml
new file mode 100644
index 00000000..88d2edde
--- /dev/null
+++ b/applications/kube-mail/package/contents/ui/main.qml
@@ -0,0 +1,138 @@
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.akonadi2.mail 1.0 as Mail
24
25ApplicationWindow {
26 id: app
27
28 //FIXME remove fixed pixel hight
29 //for now just convinience during testing
30 height: 1080 * 0.7
31 width: 1920 * 0.7
32
33 visible: true
34
35 //Controller:
36 Mail.FolderList {
37 id: folderList
38 }
39
40 Mail.MailList {
41 id: mailList
42 }
43
44 Mail.SingleMail{
45 id: singleMail
46 }
47
48 //UI
49 toolBar: ToolBar {
50
51 Row {
52 anchors.fill: parent
53
54 PlasmaComponents.ToolButton {
55
56 height: parent.height
57
58 iconName: "mail-message-new"
59
60 text: "Compose"
61 }
62
63 PlasmaComponents.ToolButton {
64
65 height: parent.height
66
67 iconName: "mail-mark-unread"
68 text: "Mark Unread"
69
70 onClicked: {
71 mailList.markMailUnread(true)
72 }
73 }
74
75 PlasmaComponents.ToolButton {
76
77 height: parent.height
78
79 iconName: "mail-mark-important"
80 text: "Mark Important"
81
82 onClicked: {
83 mailList.markMailImportant(true)
84 }
85 }
86
87 PlasmaComponents.ToolButton {
88
89 height: parent.height
90
91 iconName: "edit-delete"
92 text: "Delete Mail"
93
94 onClicked: {
95 mailList.deleteMail()
96 }
97 }
98 }
99 }
100
101 SplitView {
102 anchors.fill: parent
103
104 FolderListView {
105 id: folderListView
106
107 width: unit.size * 55
108 Layout.maximumWidth: unit.size * 150
109 Layout.minimumWidth: unit.size * 30
110 }
111
112 MailListView {
113 id: mailListView
114
115 width: unit.size * 80
116 Layout.maximumWidth: unit.size * 250
117 Layout.minimumWidth: unit.size * 50
118 }
119
120 SingleMailView {
121 id: mailView
122
123 Layout.fillWidth: true
124 }
125 }
126
127 //TODO find a better way to scale UI
128 Item {
129 id: unit
130
131 property int size: 5
132 }
133
134 ColorPalette {
135 id: colorPalette
136 }
137}
138
diff --git a/applications/kube-mail/package/metadata.desktop b/applications/kube-mail/package/metadata.desktop
new file mode 100644
index 00000000..630cc133
--- /dev/null
+++ b/applications/kube-mail/package/metadata.desktop
@@ -0,0 +1,8 @@
1[Desktop Entry]
2Name=Kube Mail
3X-KDE-PluginInfo-Name=org.kde.kube.mail
4Exec=kpackagelauncherqml -a org.kde.kube.mail
5X-Plasma-MainScript=ui/main.qml
6X-KDE-ServiceTypes=KPackage/GenericQML
7Icon=kmail2
8Type=Service