summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/kube/contents/ui/AccountsView.qml119
-rw-r--r--components/kube/contents/ui/Kube.qml14
2 files changed, 132 insertions, 1 deletions
diff --git a/components/kube/contents/ui/AccountsView.qml b/components/kube/contents/ui/AccountsView.qml
new file mode 100644
index 00000000..6ab8387b
--- /dev/null
+++ b/components/kube/contents/ui/AccountsView.qml
@@ -0,0 +1,119 @@
1/*
2 * Copyright (C) 2017 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 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
19import QtQuick 2.4
20import QtQuick.Layouts 1.1
21
22import org.kube.framework 1.0 as Kube
23
24Rectangle {
25 id: app
26
27 height: 800
28 width: 1400
29
30 color: Kube.Colors.backgroundColor
31
32 RowLayout {
33
34 anchors.fill: parent
35
36 Item {
37 id: accountList
38 width: 300
39 Layout.fillHeight: true
40
41 Kube.PositiveButton {
42 id: newAccountButton
43 anchors {
44 top: parent.top
45 left: parent.left
46 right: parent.right
47 margins: Kube.Units.largeSpacing
48 }
49 text: "New Account"
50 }
51
52 ListView {
53 id: listView
54
55 anchors {
56 top: newAccountButton.bottom
57 left: parent.left
58 right: parent.right
59 bottom: parent.bottom
60 topMargin: Kube.Units.largeSpacing
61 }
62
63 clip: true
64
65 model: Kube.AccountsModel {}
66
67 delegate: Rectangle {
68 height: Kube.Units.gridUnit * 3
69 width: listView.width
70
71 border.color: Kube.Colors.buttonColor
72 border.width: 1
73 color: Kube.Colors.viewBackgroundColor
74
75 Kube.Label {
76 anchors.centerIn: parent
77 text: model.name
78 }
79
80 MouseArea {
81 id: mouseArea
82 anchors.fill: parent
83
84 onClicked: {
85 console.log("clicked account \"" + model.accountId + "\"" )
86 //editAccountComponent.createObject(app, {accountId:model.accountId})
87 edit.accountId = model.accountId
88 }
89 }
90 }
91 }
92 }
93
94 Rectangle {
95 height: parent.height
96 width: 1
97 color: Kube.Colors.buttonColor
98 }
99
100 Item {
101
102 height: parent.height
103 width: 200
104 Layout.fillWidth: true
105
106 Kube.EditAccount {
107 id: edit
108
109 anchors {
110 top: parent.top
111 left: parent.left
112 right: parent.right
113 bottom: parent.bottom
114 margins: Kube.Units.largeSpacing
115 }
116 }
117 }
118 }
119}
diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml
index b5eee31f..18c1b6ec 100644
--- a/components/kube/contents/ui/Kube.qml
+++ b/components/kube/contents/ui/Kube.qml
@@ -152,7 +152,10 @@ Controls2.ApplicationWindow {
152 width: height 152 width: height
153 } 153 }
154 154
155 Kube.AccountSwitcher {} 155 Kube.IconButton {
156 iconName: Kube.Icons.menu_inverted
157 onClicked: kubeViews.setAccountsView()
158 }
156 } 159 }
157 } 160 }
158 StackView { 161 StackView {
@@ -173,6 +176,10 @@ Controls2.ApplicationWindow {
173 //TODO replacing here while a composer is open is destructive 176 //TODO replacing here while a composer is open is destructive
174 kubeViews.push({item: mailView, replace: true, immediate: true}) 177 kubeViews.push({item: mailView, replace: true, immediate: true})
175 } 178 }
179 function setAccountsView() {
180 kubeViews.push({item: accountsView, replace: true, immediate: true})
181 }
182
176 function openComposer() { 183 function openComposer() {
177 kubeViews.push({item: composerView, immediate: true}) 184 kubeViews.push({item: composerView, immediate: true})
178 } 185 }
@@ -193,6 +200,11 @@ Controls2.ApplicationWindow {
193 onDone: kubeViews.pop({immediate: true}) 200 onDone: kubeViews.pop({immediate: true})
194 } 201 }
195 } 202 }
203 Component {
204 id: accountsView
205 AccountsView {
206 }
207 }
196 } 208 }
197 } 209 }
198 //END Main content 210 //END Main content