diff options
Diffstat (limited to 'applications/kube-mail/package/contents/ui/main.qml')
-rw-r--r-- | applications/kube-mail/package/contents/ui/main.qml | 200 |
1 files changed, 0 insertions, 200 deletions
diff --git a/applications/kube-mail/package/contents/ui/main.qml b/applications/kube-mail/package/contents/ui/main.qml deleted file mode 100644 index cf983dee..00000000 --- a/applications/kube-mail/package/contents/ui/main.qml +++ /dev/null | |||
@@ -1,200 +0,0 @@ | |||
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 | import QtQuick.Controls 1.3 | ||
20 | import QtQuick.Layouts 1.1 | ||
21 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
22 | |||
23 | import org.kde.kube.actions 1.0 as KubeAction | ||
24 | import org.kde.kube.settings 1.0 as KubeSettings | ||
25 | |||
26 | ApplicationWindow { | ||
27 | id: app | ||
28 | |||
29 | //FIXME remove fixed pixel hight | ||
30 | //for now just convinience during testing | ||
31 | height: 1080 * 0.7 | ||
32 | width: 1920 * 0.7 | ||
33 | |||
34 | visible: true | ||
35 | |||
36 | // Action.ActionHandler { | ||
37 | // actionId: "org.kde.kube.actions.mark-as-read" | ||
38 | // function isReady(context) { | ||
39 | // return context.mail ? true : false; | ||
40 | // } | ||
41 | // | ||
42 | // function handler(context) { | ||
43 | // console.warn("Got message:", context.mail) | ||
44 | // } | ||
45 | // } | ||
46 | |||
47 | KubeAction.Context { | ||
48 | id: maillistcontext | ||
49 | property variant mail | ||
50 | mail: mailListView.currentMail | ||
51 | } | ||
52 | |||
53 | KubeAction.Action { | ||
54 | id: markAsReadAction | ||
55 | actionId: "org.kde.kube.actions.mark-as-read" | ||
56 | context: maillistcontext | ||
57 | } | ||
58 | |||
59 | KubeAction.Action { | ||
60 | id: deleteAction | ||
61 | actionId: "org.kde.kube.actions.delete" | ||
62 | context: maillistcontext | ||
63 | } | ||
64 | |||
65 | //UI | ||
66 | toolBar: ToolBar { | ||
67 | |||
68 | Row { | ||
69 | anchors.fill: parent | ||
70 | |||
71 | PlasmaComponents.ToolButton { | ||
72 | height: parent.height | ||
73 | text: "Settings" | ||
74 | onClicked: { | ||
75 | settings.visible = true | ||
76 | } | ||
77 | } | ||
78 | |||
79 | PlasmaComponents.ToolButton { | ||
80 | height: parent.height | ||
81 | iconName: "mail-message-new" | ||
82 | text: "Compose" | ||
83 | onClicked: { | ||
84 | composer.visible = true | ||
85 | } | ||
86 | } | ||
87 | |||
88 | PlasmaComponents.ToolButton { | ||
89 | height: parent.height | ||
90 | iconName: "mail-message-reply" | ||
91 | text: "Reply" | ||
92 | onClicked: { | ||
93 | composer.originalMessage = mailListView.currentMail | ||
94 | composer.visible = true | ||
95 | } | ||
96 | } | ||
97 | |||
98 | PlasmaComponents.ToolButton { | ||
99 | height: parent.height | ||
100 | iconName: "mail-mark-unread" | ||
101 | text: "Mark As Read" | ||
102 | enabled: markAsReadAction.ready | ||
103 | onClicked: { | ||
104 | markAsReadAction.execute() | ||
105 | } | ||
106 | } | ||
107 | |||
108 | PlasmaComponents.ToolButton { | ||
109 | height: parent.height | ||
110 | iconName: "mail-mark-important" | ||
111 | text: "Mark Important" | ||
112 | enabled: false | ||
113 | onClicked: { | ||
114 | } | ||
115 | } | ||
116 | |||
117 | PlasmaComponents.ToolButton { | ||
118 | height: parent.height | ||
119 | iconName: "edit-delete" | ||
120 | text: "Delete Mail" | ||
121 | enabled: deleteAction.ready | ||
122 | onClicked: { | ||
123 | deleteAction.execute() | ||
124 | } | ||
125 | } | ||
126 | |||
127 | |||
128 | } | ||
129 | Rectangle { | ||
130 | anchors { | ||
131 | right: parent.right | ||
132 | } | ||
133 | height: parent.height | ||
134 | color: "transparent" | ||
135 | Image { | ||
136 | id: img | ||
137 | height: parent.height | ||
138 | fillMode: Image.PreserveAspectCrop | ||
139 | anchors { | ||
140 | verticalCenter: parent.verticalCenter | ||
141 | left: parent.left | ||
142 | leftMargin: -20 | ||
143 | } | ||
144 | source: "image://kube/kube_logo" | ||
145 | sourceSize.height: parent.height * 2.5 | ||
146 | } | ||
147 | width: img.width * 0.7 | ||
148 | } | ||
149 | } | ||
150 | |||
151 | SplitView { | ||
152 | anchors.fill: parent | ||
153 | |||
154 | FolderListView { | ||
155 | id: folderListView | ||
156 | width: unit.size * 55 | ||
157 | Layout.maximumWidth: unit.size * 150 | ||
158 | Layout.minimumWidth: unit.size * 30 | ||
159 | } | ||
160 | |||
161 | MailListView { | ||
162 | id: mailListView | ||
163 | parentFolder: folderListView.currentFolder | ||
164 | width: unit.size * 80 | ||
165 | Layout.maximumWidth: unit.size * 250 | ||
166 | Layout.minimumWidth: unit.size * 50 | ||
167 | focus: true | ||
168 | } | ||
169 | |||
170 | SingleMailView { | ||
171 | id: mailView | ||
172 | mail: mailListView.currentMail | ||
173 | Layout.fillWidth: true | ||
174 | } | ||
175 | |||
176 | } | ||
177 | |||
178 | Settings { | ||
179 | id: settings | ||
180 | |||
181 | anchors.fill: parent | ||
182 | } | ||
183 | |||
184 | FocusComposer { | ||
185 | id: composer | ||
186 | |||
187 | anchors.fill: parent | ||
188 | } | ||
189 | |||
190 | //TODO find a better way to scale UI | ||
191 | Item { | ||
192 | id: unit | ||
193 | property int size: 5 | ||
194 | } | ||
195 | |||
196 | ColorPalette { | ||
197 | id: colorPalette | ||
198 | } | ||
199 | } | ||
200 | |||