summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-05-02 14:22:11 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-05-02 14:22:11 +0200
commit85e98907c6ea4300ad945fd3753e43cb75cafec6 (patch)
tree0684044628edee2397bf329aa25a82aff1de43db
parentd4bd3ad8d6d1f75b6c284336148e3a2c71dc1882 (diff)
downloadkube-85e98907c6ea4300ad945fd3753e43cb75cafec6.tar.gz
kube-85e98907c6ea4300ad945fd3753e43cb75cafec6.zip
Prepare different views in a stacklayout
-rw-r--r--components/kube/contents/ui/Kube.qml94
-rw-r--r--components/kube/contents/ui/MailView.qml109
-rw-r--r--components/kube/contents/ui/PeopleView.qml31
-rw-r--r--components/kube/qmldir2
-rw-r--r--framework/qml/People.qml9
5 files changed, 158 insertions, 87 deletions
diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml
index eb280471..7b6c9a83 100644
--- a/components/kube/contents/ui/Kube.qml
+++ b/components/kube/contents/ui/Kube.qml
@@ -19,7 +19,7 @@
19 19
20import QtQuick 2.7 20import QtQuick 2.7
21import QtQuick.Controls 1.3 21import QtQuick.Controls 1.3
22import QtQuick.Layouts 1.1 22import QtQuick.Layouts 1.3
23import QtQuick.Window 2.0 23import QtQuick.Window 2.0
24 24
25import QtQuick.Controls 2.0 as Controls2 25import QtQuick.Controls 2.0 as Controls2
@@ -157,91 +157,19 @@ Controls2.ApplicationWindow {
157 Kube.AccountSwitcher {} 157 Kube.AccountSwitcher {}
158 } 158 }
159 } 159 }
160 160 StackLayout {
161 SplitView { 161 id: kubeViews
162 currentIndex: 0
162 anchors { 163 anchors {
163 top: mainContent.top 164 top: mainContent.top
164 bottom: mainContent.bottom 165 bottom: mainContent.bottom
165 } 166 }
166 Layout.fillWidth: true 167 Layout.fillWidth: true
167 168 MailView {
168 Rectangle {
169 width: Kube.Units.gridUnit * 10
170 Layout.minimumWidth: Kube.Units.gridUnit * 5
171
172 color: Kube.Colors.textColor
173 focus: true
174
175 Kube.PositiveButton {
176 id: newMailButton
177
178 anchors {
179 top: parent.top
180 left: parent.left
181 right: parent.right
182 margins: Kube.Units.largeSpacing
183 }
184
185 text: qsTr("New Email")
186
187 onClicked: {
188 composer.open()
189 }
190 }
191
192 Kube.InlineAccountSwitcher {
193 id: accountFolderview
194
195 activeFocusOnTab: true
196 anchors {
197 top: newMailButton.bottom
198 topMargin: Kube.Units.largeSpacing
199 bottom: parent.bottom
200 left: newMailButton.left
201 right: parent.right
202 }
203 }
204 }
205//TODO bring back status bar
206// Item {
207// id: statusBar
208// anchors {
209// topMargin: Kube.Units.smallSpacing
210// bottom: outbox.top
211// left: parent.left
212// right: parent.right
213// }
214//
215// height: Kube.Units.gridUnit
216//
217// Repeater {
218// model: currentAccountModel
219// Kube.Label {
220// id: statusText
221// anchors.centerIn: parent
222// visible: false
223// color: Kube.Colors.highlightedTextColor
224// states: [
225// State {
226// name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus
227// PropertyChanges { target: statusText; text: "Offline"; visible: true }
228// }
229// ]
230// }
231// }
232// }
233
234 Kube.MailListView {
235 id: mailListView
236 width: Kube.Units.gridUnit * 20
237 height: parent.height
238 Layout.minimumWidth: Kube.Units.gridUnit * 10
239 }
240
241 Kube.ConversationView {
242 id: mailView 169 id: mailView
243 Layout.fillWidth: true 170 }
244 Layout.minimumWidth: Kube.Units.gridUnit * 5 171 PeopleView {
172 id: peopleView
245 } 173 }
246 } 174 }
247 } 175 }
@@ -320,15 +248,17 @@ Controls2.ApplicationWindow {
320 //END Search 248 //END Search
321 249
322 //BEGIN People 250 //BEGIN People
323 Kube.People { 251 Kube.Popup {
324 id: people 252 id: people
325
326 height: app.height * 0.85 253 height: app.height * 0.85
327 width: app.width * 0.85 254 width: app.width * 0.85
328 255
329 x: app.width * 0.075 256 x: app.width * 0.075
330 y: app.height * 0.075 257 y: app.height * 0.075
331 258
259 Kube.People {
260 anchors.fill: parent
261 }
332 } 262 }
333 //END People 263 //END People
334} 264}
diff --git a/components/kube/contents/ui/MailView.qml b/components/kube/contents/ui/MailView.qml
new file mode 100644
index 00000000..b23dd06a
--- /dev/null
+++ b/components/kube/contents/ui/MailView.qml
@@ -0,0 +1,109 @@
1/*
2 * Copyright (C) 2017 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20
21import QtQuick 2.7
22import QtQuick.Controls 1.3
23import QtQuick.Layouts 1.1
24
25import org.kube.framework 1.0 as Kube
26
27SplitView {
28 Layout.fillWidth: true
29
30 Rectangle {
31 width: Kube.Units.gridUnit * 10
32 Layout.minimumWidth: Kube.Units.gridUnit * 5
33
34 color: Kube.Colors.textColor
35 focus: true
36
37 Kube.PositiveButton {
38 id: newMailButton
39
40 anchors {
41 top: parent.top
42 left: parent.left
43 right: parent.right
44 margins: Kube.Units.largeSpacing
45 }
46
47 text: qsTr("New Email")
48
49 onClicked: {
50 composer.open()
51 }
52 }
53
54 Kube.InlineAccountSwitcher {
55 id: accountFolderview
56
57 activeFocusOnTab: true
58 anchors {
59 top: newMailButton.bottom
60 topMargin: Kube.Units.largeSpacing
61 bottom: parent.bottom
62 left: newMailButton.left
63 right: parent.right
64 }
65 }
66 }
67
68//TODO bring back status bar
69// Item {
70// id: statusBar
71// anchors {
72// topMargin: Kube.Units.smallSpacing
73// bottom: outbox.top
74// left: parent.left
75// right: parent.right
76// }
77//
78// height: Kube.Units.gridUnit
79//
80// Repeater {
81// model: currentAccountModel
82// Kube.Label {
83// id: statusText
84// anchors.centerIn: parent
85// visible: false
86// color: Kube.Colors.highlightedTextColor
87// states: [
88// State {
89// name: "disconnected"; when: model.status == Kube.AccountsModel.OfflineStatus
90// PropertyChanges { target: statusText; text: "Offline"; visible: true }
91// }
92// ]
93// }
94// }
95// }
96
97 Kube.MailListView {
98 id: mailListView
99 width: Kube.Units.gridUnit * 20
100 height: parent.height
101 Layout.minimumWidth: Kube.Units.gridUnit * 10
102 }
103
104 Kube.ConversationView {
105 id: mailView
106 Layout.fillWidth: true
107 Layout.minimumWidth: Kube.Units.gridUnit * 5
108 }
109}
diff --git a/components/kube/contents/ui/PeopleView.qml b/components/kube/contents/ui/PeopleView.qml
new file mode 100644
index 00000000..8d7a9fbd
--- /dev/null
+++ b/components/kube/contents/ui/PeopleView.qml
@@ -0,0 +1,31 @@
1/*
2 * Copyright (C) 2017 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20
21import QtQuick 2.7
22import QtQuick.Controls 1.3
23import QtQuick.Layouts 1.1
24
25import org.kube.framework 1.0 as Kube
26
27Kube.People {
28 id: people
29
30 Layout.fillWidth: true
31}
diff --git a/components/kube/qmldir b/components/kube/qmldir
index f663c916..95e7909e 100644
--- a/components/kube/qmldir
+++ b/components/kube/qmldir
@@ -1,3 +1,5 @@
1module org.kube.components.kube 1module org.kube.components.kube
2 2
3Kube 1.0 Kube.qml 3Kube 1.0 Kube.qml
4MailView 1.0 MailView.qml
5PeopleView 1.0 PeopleView.qml
diff --git a/framework/qml/People.qml b/framework/qml/People.qml
index e8a4fca3..58aa340c 100644
--- a/framework/qml/People.qml
+++ b/framework/qml/People.qml
@@ -26,12 +26,11 @@ import org.kde.kirigami 1.0 as Kirigami
26import org.kube.framework 1.0 as Kube 26import org.kube.framework 1.0 as Kube
27 27
28 28
29Kube.Popup { 29Item {
30 id: popup 30 id: root
31 31
32 property var currentContact 32 property var currentContact
33 33
34 modal: true
35 onVisibleChanged: { 34 onVisibleChanged: {
36 if (visible) { 35 if (visible) {
37 Kube.Fabric.postMessage(Kube.Messages.synchronize, {"type": "contacts"}); 36 Kube.Fabric.postMessage(Kube.Messages.synchronize, {"type": "contacts"});
@@ -143,7 +142,7 @@ Kube.Popup {
143 anchors.fill: parent 142 anchors.fill: parent
144 143
145 onClicked: { 144 onClicked: {
146 popup.currentContact = model.domainObject 145 root.currentContact = model.domainObject
147 stack.push(personPage) 146 stack.push(personPage)
148 } 147 }
149 } 148 }
@@ -197,7 +196,7 @@ Kube.Popup {
197 196
198 Kube.ContactController { 197 Kube.ContactController {
199 id: contactController 198 id: contactController
200 contact: popup.currentContact 199 contact: root.currentContact
201 } 200 }
202 201
203 color: Kube.Colors.viewBackgroundColor 202 color: Kube.Colors.viewBackgroundColor