diff options
Diffstat (limited to 'views/inboxcrusher/qml/View.qml')
-rw-r--r-- | views/inboxcrusher/qml/View.qml | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/views/inboxcrusher/qml/View.qml b/views/inboxcrusher/qml/View.qml new file mode 100644 index 00000000..7059a8eb --- /dev/null +++ b/views/inboxcrusher/qml/View.qml | |||
@@ -0,0 +1,102 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com> | ||
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 2 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 along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | import QtQuick 2.4 | ||
20 | import QtQuick.Layouts 1.1 | ||
21 | import QtQuick.Controls 2.0 | ||
22 | import org.kube.framework 1.0 as Kube | ||
23 | |||
24 | FocusScope { | ||
25 | id: root | ||
26 | property variant currentMail: null | ||
27 | |||
28 | Keys.onRightPressed: { | ||
29 | modelIndexRetriever.currentIndex = modelIndexRetriever.currentIndex + 1 | ||
30 | } | ||
31 | Keys.onLeftPressed: { | ||
32 | if (modelIndexRetriever.currentIndex > 0) { | ||
33 | modelIndexRetriever.currentIndex = modelIndexRetriever.currentIndex - 1 | ||
34 | } | ||
35 | } | ||
36 | Kube.ModelIndexRetriever { | ||
37 | id: modelIndexRetriever | ||
38 | model: Kube.MailListModel { | ||
39 | showInbox: true | ||
40 | } | ||
41 | currentIndex: 0 | ||
42 | onCurrentDataChanged: { | ||
43 | root.currentMail = currentData.mail | ||
44 | } | ||
45 | } | ||
46 | Column { | ||
47 | anchors.fill: parent | ||
48 | spacing: Kube.Units.smallSpacing | ||
49 | Repeater { | ||
50 | anchors { | ||
51 | left: parent.left | ||
52 | right: parent.right | ||
53 | } | ||
54 | model: Kube.MailListModel { | ||
55 | mail: root.currentMail | ||
56 | } | ||
57 | Kube.MailViewer { | ||
58 | anchors { | ||
59 | left: parent.left | ||
60 | right: parent.right | ||
61 | } | ||
62 | message: model.mimeMessage | ||
63 | subject: model.subject | ||
64 | sender: model.sender | ||
65 | senderName: model.senderName | ||
66 | to: model.to | ||
67 | cc: model.cc | ||
68 | bcc: model.bcc | ||
69 | date: model.date | ||
70 | unread: model.unread | ||
71 | trash: model.trash | ||
72 | draft: model.draft | ||
73 | sent: model.sent | ||
74 | incomplete: model.incomplete | ||
75 | current: true | ||
76 | } | ||
77 | } | ||
78 | Row { | ||
79 | spacing: Kube.Units.smallSpacing | ||
80 | anchors { | ||
81 | horizontalCenter: parent.horizontalCenter | ||
82 | } | ||
83 | height: Kube.Units.gridUnit | ||
84 | Kube.Button { | ||
85 | focus: true | ||
86 | text: qsTr("Delete!") | ||
87 | onClicked: { | ||
88 | } | ||
89 | } | ||
90 | Kube.Button { | ||
91 | text: qsTr("Reply!") | ||
92 | onClicked: { | ||
93 | } | ||
94 | } | ||
95 | Kube.Button { | ||
96 | text: qsTr("Flag!") | ||
97 | onClicked: { | ||
98 | } | ||
99 | } | ||
100 | } | ||
101 | } | ||
102 | } | ||