diff options
author | Michael Bohlender <michael.bohlender@kdemail.net> | 2016-04-03 02:17:25 +0200 |
---|---|---|
committer | Michael Bohlender <michael.bohlender@kdemail.net> | 2016-04-03 02:17:25 +0200 |
commit | 5f2a3aa64cedc7f5517a1047dd699a286faf1898 (patch) | |
tree | 69a7cdd7b30c2966318c0e444b5cd39f3a46d292 /applications/mail-mobile | |
parent | db8d420485fe75ebbb45f4b6db978311c0dbf8c1 (diff) | |
download | kube-5f2a3aa64cedc7f5517a1047dd699a286faf1898.tar.gz kube-5f2a3aa64cedc7f5517a1047dd699a286faf1898.zip |
port mail mobile to kirigami components + implement VDG Mockups
Diffstat (limited to 'applications/mail-mobile')
-rw-r--r-- | applications/mail-mobile/Avatar.qml | 54 | ||||
-rw-r--r-- | applications/mail-mobile/ComposerPage.qml | 56 | ||||
-rw-r--r-- | applications/mail-mobile/FolderListModel.qml | 56 | ||||
-rw-r--r-- | applications/mail-mobile/FolderPage.qml | 120 | ||||
-rw-r--r-- | applications/mail-mobile/MailListModel.qml | 149 | ||||
-rw-r--r-- | applications/mail-mobile/MailListPage.qml | 120 | ||||
-rw-r--r-- | applications/mail-mobile/SingleMailPage.qml | 131 | ||||
-rw-r--r-- | applications/mail-mobile/main.qml | 81 |
8 files changed, 767 insertions, 0 deletions
diff --git a/applications/mail-mobile/Avatar.qml b/applications/mail-mobile/Avatar.qml new file mode 100644 index 00000000..592a3f99 --- /dev/null +++ b/applications/mail-mobile/Avatar.qml | |||
@@ -0,0 +1,54 @@ | |||
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 | |||
18 | import QtQuick 2.4 | ||
19 | |||
20 | Rectangle { | ||
21 | |||
22 | property string name; | ||
23 | |||
24 | //TODO should we make this themeable ? | ||
25 | function calcColor(x) | ||
26 | { | ||
27 | switch (x % 5) { | ||
28 | case 0: | ||
29 | return "#16a085" | ||
30 | case 1: | ||
31 | return "#27ae60" | ||
32 | case 2: | ||
33 | return "#2980b9" | ||
34 | case 3: | ||
35 | return "#8e44ad" | ||
36 | case 4: | ||
37 | return "#c0392b" | ||
38 | } | ||
39 | } | ||
40 | |||
41 | radius: 100 | ||
42 | |||
43 | color: calcColor(name.length) | ||
44 | |||
45 | Text { | ||
46 | anchors.centerIn: parent | ||
47 | |||
48 | text: name.charAt(0) | ||
49 | |||
50 | color: "#ecf0f1" | ||
51 | |||
52 | font.capitalization: Font.AllUppercase | ||
53 | } | ||
54 | } | ||
diff --git a/applications/mail-mobile/ComposerPage.qml b/applications/mail-mobile/ComposerPage.qml new file mode 100644 index 00000000..2e96a803 --- /dev/null +++ b/applications/mail-mobile/ComposerPage.qml | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 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 | |||
18 | import QtQuick 2.4 | ||
19 | import QtQuick.Controls 1.4 as Controls | ||
20 | import QtQuick.Layouts 1.2 | ||
21 | |||
22 | import org.kde.kirigami 1.0 as Kirigami | ||
23 | |||
24 | Kirigami.Page { | ||
25 | id: root | ||
26 | |||
27 | anchors.fill: parent | ||
28 | |||
29 | background: Rectangle { | ||
30 | color: Kirigami.Theme.viewBackgroundColor | ||
31 | } | ||
32 | |||
33 | title: "Compose" | ||
34 | |||
35 | ColumnLayout { | ||
36 | anchors.fill: parent | ||
37 | |||
38 | Controls.TextField { | ||
39 | Layout.fillWidth: true | ||
40 | |||
41 | placeholderText: "To" | ||
42 | } | ||
43 | |||
44 | Controls.TextField { | ||
45 | Layout.fillWidth: true | ||
46 | |||
47 | placeholderText: "Subject" | ||
48 | } | ||
49 | |||
50 | Controls.TextArea { | ||
51 | Layout.fillWidth: true | ||
52 | Layout.fillHeight: true | ||
53 | } | ||
54 | } | ||
55 | |||
56 | } | ||
diff --git a/applications/mail-mobile/FolderListModel.qml b/applications/mail-mobile/FolderListModel.qml new file mode 100644 index 00000000..82622bfb --- /dev/null +++ b/applications/mail-mobile/FolderListModel.qml | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 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 | |||
18 | import QtQuick 2.4 | ||
19 | |||
20 | ListModel { | ||
21 | ListElement { | ||
22 | icon: "mail-folder-inbox" | ||
23 | name: "Inbox" | ||
24 | } | ||
25 | ListElement { | ||
26 | icon: "mail-folder-sent" | ||
27 | name: "Sent" | ||
28 | } | ||
29 | ListElement { | ||
30 | icon: "user-trash" | ||
31 | name: "Trash" | ||
32 | } | ||
33 | ListElement { | ||
34 | icon: "document-edit" | ||
35 | name: "Drafts" | ||
36 | } | ||
37 | |||
38 | ListElement { | ||
39 | icon: "folder" | ||
40 | name: "dragons" | ||
41 | } | ||
42 | ListElement { | ||
43 | icon: "folder" | ||
44 | name: "long tailed dragons" | ||
45 | } | ||
46 | |||
47 | ListElement { | ||
48 | icon: "folder" | ||
49 | name: "pim" | ||
50 | } | ||
51 | ListElement { | ||
52 | icon: "folder" | ||
53 | name: "vdg" | ||
54 | } | ||
55 | |||
56 | } | ||
diff --git a/applications/mail-mobile/FolderPage.qml b/applications/mail-mobile/FolderPage.qml new file mode 100644 index 00000000..42c150e8 --- /dev/null +++ b/applications/mail-mobile/FolderPage.qml | |||
@@ -0,0 +1,120 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 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 | |||
18 | import QtQuick 2.4 | ||
19 | import QtQuick.Controls 1.4 as Controls | ||
20 | import QtQuick.Layouts 1.2 | ||
21 | |||
22 | import org.kde.kirigami 1.0 as Kirigami | ||
23 | |||
24 | Kirigami.ScrollablePage { | ||
25 | id: root | ||
26 | |||
27 | anchors.fill: parent | ||
28 | |||
29 | background: Rectangle { | ||
30 | color: Kirigami.Theme.viewBackgroundColor | ||
31 | } | ||
32 | |||
33 | mainAction: Kirigami.Action { | ||
34 | iconName: "mail-message-new" | ||
35 | |||
36 | onTriggered: { | ||
37 | app.pageStack.push(Qt.resolvedUrl("ComposerPage.qml")) | ||
38 | } | ||
39 | |||
40 | } | ||
41 | |||
42 | ListView { | ||
43 | id: listView | ||
44 | |||
45 | model: MailListModel {} | ||
46 | |||
47 | delegate: Kirigami.SwipeListItem { | ||
48 | id: mailListDelegate | ||
49 | |||
50 | property bool important: model.important | ||
51 | property bool unread: model.unread | ||
52 | |||
53 | actions: [ | ||
54 | Kirigami.Action { | ||
55 | iconName: "mail-mark-important" | ||
56 | |||
57 | onTriggered: { | ||
58 | if(important) { | ||
59 | important = false | ||
60 | } else { | ||
61 | important = true | ||
62 | } | ||
63 | } | ||
64 | }, | ||
65 | Kirigami.Action { | ||
66 | iconName: "mail-mark-unread-new" | ||
67 | |||
68 | onTriggered: { | ||
69 | if(unread) { | ||
70 | unread = false | ||
71 | } else { | ||
72 | unread = true | ||
73 | } | ||
74 | } | ||
75 | }, | ||
76 | Kirigami.Action { | ||
77 | iconName: "entry-delete" | ||
78 | } | ||
79 | ] | ||
80 | |||
81 | enabled: true | ||
82 | |||
83 | onClicked: { | ||
84 | app.pageStack.push(Qt.resolvedUrl("MailListPage.qml")) | ||
85 | } | ||
86 | |||
87 | RowLayout { | ||
88 | anchors.fill: parent | ||
89 | |||
90 | width: parent.width | ||
91 | |||
92 | Avatar { | ||
93 | id: avatar | ||
94 | |||
95 | height: textItem.height * 0.9 | ||
96 | width: height | ||
97 | |||
98 | name: model.sender | ||
99 | } | ||
100 | |||
101 | ColumnLayout { | ||
102 | id: textItem | ||
103 | |||
104 | Controls.Label { | ||
105 | text: model.subject | ||
106 | |||
107 | color: important ? "#da4453" : unread ? "#1d99f3" : Kirigami.Theme.textColor | ||
108 | } | ||
109 | |||
110 | Controls.Label { | ||
111 | text: model.sender | ||
112 | } | ||
113 | Item { | ||
114 | Layout.fillWidth: true | ||
115 | } | ||
116 | } | ||
117 | } | ||
118 | } | ||
119 | } | ||
120 | } | ||
diff --git a/applications/mail-mobile/MailListModel.qml b/applications/mail-mobile/MailListModel.qml new file mode 100644 index 00000000..28b6766f --- /dev/null +++ b/applications/mail-mobile/MailListModel.qml | |||
@@ -0,0 +1,149 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 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 | |||
18 | import QtQuick 2.4 | ||
19 | |||
20 | ListModel { | ||
21 | ListElement { | ||
22 | sender: "mighty@mail.com" | ||
23 | senderName: "Mighty Monkey" | ||
24 | subject: "I feel weak without my bananas" | ||
25 | date: "Today 19:21" | ||
26 | unread: true | ||
27 | } | ||
28 | ListElement { | ||
29 | sender: "benni@bandana.org" | ||
30 | senderName: "Ben Bandana" | ||
31 | subject: "Check this out" | ||
32 | date: "Today 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: "Today 12:55" | ||
40 | unread: false | ||
41 | } | ||
42 | ListElement { | ||
43 | sender: "bob@bandana.org" | ||
44 | senderName: "Bob Ross" | ||
45 | subject: "KDE Rocks" | ||
46 | date: "Today 07:32" | ||
47 | unread: true | ||
48 | } | ||
49 | ListElement { | ||
50 | sender: "tiny@mail.com" | ||
51 | senderName: "Tiny" | ||
52 | subject: "Huge success!!" | ||
53 | date: "Today 00:11" | ||
54 | unread: false | ||
55 | } | ||
56 | ListElement { | ||
57 | sender: "bob@bandana.org" | ||
58 | senderName: "Bob Ross" | ||
59 | subject: "KDE Rocks" | ||
60 | date: "Yesterday 20:54" | ||
61 | unread: false | ||
62 | } | ||
63 | ListElement { | ||
64 | sender: "Laura@mail.com" | ||
65 | senderName: "Laura B" | ||
66 | subject: ":)" | ||
67 | date: "Monday 12:37" | ||
68 | unread: false | ||
69 | } | ||
70 | ListElement { | ||
71 | sender: "Andreas@stars.org" | ||
72 | senderName: "Andreas Rockstar" | ||
73 | subject: "KDE Rocks" | ||
74 | date: "Monday 12:37" | ||
75 | unread: false | ||
76 | } | ||
77 | ListElement { | ||
78 | sender: "alice@mail.com" | ||
79 | senderName: "Alice Cheng" | ||
80 | subject: "Re: We need more food" | ||
81 | date: "Monday 12:37" | ||
82 | } | ||
83 | ListElement { | ||
84 | sender: "bob@bandana.org" | ||
85 | senderName: "Bob Ross" | ||
86 | subject: "KDE Rocks" | ||
87 | date: "Monday 12:37" | ||
88 | } | ||
89 | ListElement { | ||
90 | sender: "mighty@mail.com" | ||
91 | senderName: "Mighty Monkey" | ||
92 | subject: "I feel weak without my bananas" | ||
93 | date: "2 hours ago" | ||
94 | } | ||
95 | ListElement { | ||
96 | sender: "benni@bandana.org" | ||
97 | senderName: "Ben Bandana" | ||
98 | subject: "Check this out" | ||
99 | date: "8 hours ago" | ||
100 | } | ||
101 | ListElement { | ||
102 | sender: "alice@mail.com" | ||
103 | senderName: "Alice Cheng" | ||
104 | subject: "Re: We need more food" | ||
105 | date: "2 hours ago" | ||
106 | } | ||
107 | ListElement { | ||
108 | sender: "bob@bandana.org" | ||
109 | senderName: "Bob Ross" | ||
110 | subject: "KDE Rocks" | ||
111 | date: "8 hours ago" | ||
112 | } | ||
113 | ListElement { | ||
114 | sender: "tiny@mail.com" | ||
115 | senderName: "Tiny" | ||
116 | subject: "Huge success!!" | ||
117 | date: "2 hours ago" | ||
118 | } | ||
119 | ListElement { | ||
120 | sender: "bob@bandana.org" | ||
121 | senderName: "Bob Ross" | ||
122 | subject: "KDE Rocks" | ||
123 | date: "8 hours ago" | ||
124 | } | ||
125 | ListElement { | ||
126 | sender: "Laura@mail.com" | ||
127 | senderName: "Laura B" | ||
128 | subject: ":)" | ||
129 | date: "2 hours ago" | ||
130 | } | ||
131 | ListElement { | ||
132 | sender: "Andreas@stars.org" | ||
133 | senderName: "Andreas Rockstar" | ||
134 | subject: "KDE Rocks" | ||
135 | date: "8 hours ago" | ||
136 | } | ||
137 | ListElement { | ||
138 | sender: "alice@mail.com" | ||
139 | senderName: "Alice Cheng" | ||
140 | subject: "Re: We need more food" | ||
141 | date: "2 hours ago" | ||
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: "8 hours ago" | ||
148 | } | ||
149 | } | ||
diff --git a/applications/mail-mobile/MailListPage.qml b/applications/mail-mobile/MailListPage.qml new file mode 100644 index 00000000..a8dc87e2 --- /dev/null +++ b/applications/mail-mobile/MailListPage.qml | |||
@@ -0,0 +1,120 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 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 | |||
18 | import QtQuick 2.4 | ||
19 | import QtQuick.Controls 1.4 as Controls | ||
20 | import QtQuick.Layouts 1.2 | ||
21 | |||
22 | import org.kde.kirigami 1.0 as Kirigami | ||
23 | |||
24 | Kirigami.ScrollablePage { | ||
25 | id: root | ||
26 | |||
27 | anchors.fill: parent | ||
28 | |||
29 | background: Rectangle { | ||
30 | color: Kirigami.Theme.viewBackgroundColor | ||
31 | } | ||
32 | |||
33 | mainAction: Kirigami.Action { | ||
34 | iconName: "mail-message-new" | ||
35 | |||
36 | onTriggered: { | ||
37 | app.pageStack.push(Qt.resolvedUrl("ComposerPage.qml")) | ||
38 | } | ||
39 | |||
40 | } | ||
41 | |||
42 | ListView { | ||
43 | id: listView | ||
44 | |||
45 | model: MailListModel {} | ||
46 | |||
47 | delegate: Kirigami.SwipeListItem { | ||
48 | id: mailListDelegate | ||
49 | |||
50 | property bool important: model.important | ||
51 | property bool unread: model.unread | ||
52 | |||
53 | actions: [ | ||
54 | Kirigami.Action { | ||
55 | iconName: "mail-mark-important" | ||
56 | |||
57 | onTriggered: { | ||
58 | if(important) { | ||
59 | important = false | ||
60 | } else { | ||
61 | important = true | ||
62 | } | ||
63 | } | ||
64 | }, | ||
65 | Kirigami.Action { | ||
66 | iconName: "mail-mark-unread-new" | ||
67 | |||
68 | onTriggered: { | ||
69 | if(unread) { | ||
70 | unread = false | ||
71 | } else { | ||
72 | unread = true | ||
73 | } | ||
74 | } | ||
75 | }, | ||
76 | Kirigami.Action { | ||
77 | iconName: "entry-delete" | ||
78 | } | ||
79 | ] | ||
80 | |||
81 | enabled: true | ||
82 | |||
83 | onClicked: { | ||
84 | app.pageStack.push(Qt.resolvedUrl("SingleMailPage.qml")) | ||
85 | } | ||
86 | |||
87 | RowLayout { | ||
88 | anchors.fill: parent | ||
89 | |||
90 | width: parent.width | ||
91 | |||
92 | Avatar { | ||
93 | id: avatar | ||
94 | |||
95 | height: textItem.height * 0.9 | ||
96 | width: height | ||
97 | |||
98 | name: model.sender | ||
99 | } | ||
100 | |||
101 | ColumnLayout { | ||
102 | id: textItem | ||
103 | |||
104 | Controls.Label { | ||
105 | text: model.subject | ||
106 | |||
107 | color: important ? "#da4453" : unread ? "#1d99f3" : Kirigami.Theme.textColor | ||
108 | } | ||
109 | |||
110 | Controls.Label { | ||
111 | text: model.sender | ||
112 | } | ||
113 | Item { | ||
114 | Layout.fillWidth: true | ||
115 | } | ||
116 | } | ||
117 | } | ||
118 | } | ||
119 | } | ||
120 | } | ||
diff --git a/applications/mail-mobile/SingleMailPage.qml b/applications/mail-mobile/SingleMailPage.qml new file mode 100644 index 00000000..a5ee9b98 --- /dev/null +++ b/applications/mail-mobile/SingleMailPage.qml | |||
@@ -0,0 +1,131 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 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 | |||
18 | import QtQuick 2.4 | ||
19 | import QtQuick.Controls 1.3 as Controls | ||
20 | import QtQuick.Layouts 1.1 | ||
21 | |||
22 | import org.kde.kirigami 1.0 as Kirigami | ||
23 | |||
24 | Kirigami.ScrollablePage { | ||
25 | id: root | ||
26 | |||
27 | background: Rectangle { | ||
28 | color: Kirigami.Theme.viewBackgroundColor | ||
29 | } | ||
30 | |||
31 | title: "Read" | ||
32 | |||
33 | mainAction: Kirigami.Action { | ||
34 | iconName: "mail-reply-sender" | ||
35 | |||
36 | onTriggered: { | ||
37 | app.pageStack.push(Qt.resolvedUrl("ComposerPage.qml")) | ||
38 | } | ||
39 | |||
40 | } | ||
41 | contextualActions: [ | ||
42 | Kirigami.Action { | ||
43 | text:"Forward" | ||
44 | iconName: "mail-forward" | ||
45 | onTriggered: { | ||
46 | app.contextDrawer.close() | ||
47 | app.pageStack.push(Qt.resolvedUrl("ComposerPage.qml")) | ||
48 | } | ||
49 | } | ||
50 | ] | ||
51 | |||
52 | Item { | ||
53 | |||
54 | Layout.fillWidth: true | ||
55 | |||
56 | Item { | ||
57 | id: model | ||
58 | property string subject: "We need more Food" | ||
59 | property string sender: "Alice Trump" | ||
60 | property string senderAddress: "alice@wonderland.net" | ||
61 | property string cc: "vdg@kde.org; ross@ccmail.com" | ||
62 | property string time: "2 days ago" | ||
63 | property string body: "Hi Bob, \n \n Ut nibh massa, volutpat quis diam quis, tincidunt consectetur massa. Nulla eu ultricies justo, eu aliquam lacus. Maecenas at interdum est, at luctus nibh. Quisque scelerisque consequat lectus vitae egestas. Maecenas molestie risus id enim consequat dapibus. Ut dapibus hendrerit est, ut aliquam ex fringilla commodo. Donec rutru semper sit amet elit ut volutpat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae. \n \n Cheers, \n \n Alice" | ||
64 | } | ||
65 | |||
66 | Item { | ||
67 | id: content | ||
68 | |||
69 | width: parent.width | ||
70 | |||
71 | Kirigami.Heading { | ||
72 | id: subject | ||
73 | text: model.subject | ||
74 | |||
75 | Layout.fillWidth: true | ||
76 | } | ||
77 | |||
78 | Kirigami.Label { | ||
79 | |||
80 | anchors { | ||
81 | top: subject.bottom | ||
82 | } | ||
83 | |||
84 | text: "From:" | ||
85 | } | ||
86 | |||
87 | Kirigami.Label { | ||
88 | id: sender | ||
89 | anchors { | ||
90 | top: avatar.top | ||
91 | right: avatar.left | ||
92 | } | ||
93 | |||
94 | text: model.sender | ||
95 | } | ||
96 | |||
97 | Kirigami.Label { | ||
98 | |||
99 | anchors { | ||
100 | bottom: avatar.bottom | ||
101 | right: avatar.left | ||
102 | } | ||
103 | |||
104 | text: model.senderAddress | ||
105 | } | ||
106 | |||
107 | Avatar { | ||
108 | id: avatar | ||
109 | |||
110 | anchors { | ||
111 | top: subject.bottom | ||
112 | right: content.right | ||
113 | } | ||
114 | name: model.sender | ||
115 | |||
116 | height: subject.height | ||
117 | width: subject.height | ||
118 | } | ||
119 | |||
120 | Kirigami.Label { | ||
121 | anchors.top: avatar.bottom | ||
122 | |||
123 | width: parent.width | ||
124 | |||
125 | wrapMode: Text.WordWrap | ||
126 | |||
127 | text: model.body | ||
128 | } | ||
129 | } | ||
130 | } | ||
131 | } | ||
diff --git a/applications/mail-mobile/main.qml b/applications/mail-mobile/main.qml new file mode 100644 index 00000000..d3db3b7f --- /dev/null +++ b/applications/mail-mobile/main.qml | |||
@@ -0,0 +1,81 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 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 | |||
18 | import QtQuick 2.4 | ||
19 | import QtQuick.Controls 1.4 as Controls | ||
20 | import QtQuick.Layouts 1.2 | ||
21 | |||
22 | import org.kde.kirigami 1.0 as Kirigami | ||
23 | |||
24 | Kirigami.ApplicationWindow { | ||
25 | id: app | ||
26 | |||
27 | //FIXME remove fixed pixel hight | ||
28 | //for now just convinience during testing | ||
29 | width: 1080 / 2.7 | ||
30 | height: (1920 - 40)/ 2.7 | ||
31 | |||
32 | visible: true | ||
33 | |||
34 | globalDrawer: Kirigami.GlobalDrawer { | ||
35 | title: "Kube Mail" | ||
36 | titleIcon: "kmail" | ||
37 | |||
38 | actions: [ | ||
39 | Kirigami.Action { | ||
40 | text: "Unread" | ||
41 | onTriggered: { | ||
42 | |||
43 | |||
44 | pageStack.initialPage = Qt.resolvedUrl("MailListPage.qml"); | ||
45 | } | ||
46 | }, | ||
47 | Kirigami.Action { | ||
48 | text: "Imporant" | ||
49 | }, | ||
50 | Kirigami.Action { | ||
51 | text: "Drafts" | ||
52 | }, | ||
53 | Kirigami.Action { | ||
54 | text: "All Mail" | ||
55 | } | ||
56 | ] | ||
57 | |||
58 | ListView { | ||
59 | id: listView | ||
60 | |||
61 | anchors.fill: parent | ||
62 | |||
63 | model: FolderListModel {} | ||
64 | |||
65 | delegate: Kirigami.BasicListItem { | ||
66 | |||
67 | label: model.name | ||
68 | |||
69 | enabled: true | ||
70 | } | ||
71 | } | ||
72 | } | ||
73 | |||
74 | contextDrawer: Kirigami.ContextDrawer { | ||
75 | id: contextDrawer | ||
76 | } | ||
77 | |||
78 | pageStack.initialPage: MailListPage { | ||
79 | title: "Inbox" | ||
80 | } | ||
81 | } | ||