summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2016-06-15 18:32:54 +0200
committerMichael Bohlender <michael.bohlender@kdemail.net>2016-06-15 18:32:54 +0200
commit6d2b4f84b0efdb6b1d6c207ed2ab6fc06c140ab8 (patch)
tree28b80bef620072774d17b02b02d1e6c03feae098
parent1949e99b01b223998d40a0bb5ff2ac4b9177bea4 (diff)
downloadkube-6d2b4f84b0efdb6b1d6c207ed2ab6fc06c140ab8.tar.gz
kube-6d2b4f84b0efdb6b1d6c207ed2ab6fc06c140ab8.zip
add add account / sync / edit account buttons
-rw-r--r--components/mail/contents/ui/main.qml78
-rw-r--r--components/package/contents/ui/AccountSwitcher.qml129
2 files changed, 178 insertions, 29 deletions
diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml
index 7b318991..4d60e71b 100644
--- a/components/mail/contents/ui/main.qml
+++ b/components/mail/contents/ui/main.qml
@@ -157,21 +157,65 @@ ApplicationWindow {
157 width: 600 157 width: 600
158 158
159 color: "lightgrey" //FIXME create a propper dialog thingy 159 color: "lightgrey" //FIXME create a propper dialog thingy
160
161 clip: true 160 clip: true
162 161
162 Item {
163 id: footer
164
165 anchors {
166 bottom: parent.bottom
167 left: parent.left
168 right: parent.right
169 margins: Kirigami.Units.largeSpacing
170 }
171
172 height: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 1
173 width: listView.width
174
175 Button {
176
177 anchors {
178 verticalCenter: parent.verticalCenter
179 right: parent.right
180 }
181
182 text: "Create new Account"
183 }
184
185 Button {
186
187 anchors {
188 verticalCenter: parent.verticalCenter
189 left: parent.left
190 }
191
192 iconName: "view-refresh"
193 text: "Sync"
194 enabled: syncAction.ready
195
196 onClicked: {
197 syncAction.execute()
198 }
199 }
200 }
201
163 ListView { 202 ListView {
164 id: listView 203 id: listView
165 204
166 anchors.fill: parent 205 anchors {
167 206 top: parent.top
168 footer: Button { 207 bottom: footer.top
169 text: "Create new Account" 208 left: parent.left
209 right: parent.right
170 } 210 }
171 211
212 clip: true
213
172 model: KubeFramework.AccountsModel { } 214 model: KubeFramework.AccountsModel { }
173 215
174 delegate: Kirigami.AbstractListItem { 216 delegate: Kirigami.AbstractListItem {
217 id: accountDelegate
218
175 enabled: true 219 enabled: true
176 supportsMouseEvents: true 220 supportsMouseEvents: true
177 221
@@ -200,8 +244,6 @@ ApplicationWindow {
200 Label { 244 Label {
201 text: model.name === "" ? accountFactory.name : model.name 245 text: model.name === "" ? accountFactory.name : model.name
202 } 246 }
203
204
205 } 247 }
206 Button { 248 Button {
207 249
@@ -210,34 +252,18 @@ ApplicationWindow {
210 margins: Kirigami.Units.largeSpacing 252 margins: Kirigami.Units.largeSpacing
211 } 253 }
212 254
213 255 visible: accountDelegate.containsMouse
214 text: "edit" 256 text: "edit"
215 } 257 }
216 } 258 }
217 } 259 }
218 } 260 }
219
220 } 261 }
221
222 } 262 }
223 263
224 /* 264 /*
225 * KubeComponents.AccountSwitcher { 265 *
226 * Layout.fillHeight: true 266 */
227 * Layout.fillWidth: true
228 }
229
230
231 ToolButton {
232 iconName: "view-refresh"
233 text: "Sync"
234 enabled: syncAction.ready
235
236 onClicked: {
237 syncAction.execute()
238 }
239 }
240 */
241 } 267 }
242 //END Folderlist section 268 //END Folderlist section
243 269
diff --git a/components/package/contents/ui/AccountSwitcher.qml b/components/package/contents/ui/AccountSwitcher.qml
index 0e620854..67c34792 100644
--- a/components/package/contents/ui/AccountSwitcher.qml
+++ b/components/package/contents/ui/AccountSwitcher.qml
@@ -21,7 +21,130 @@ import QtQuick.Layouts 1.1
21 21
22import org.kube.framework.domain 1.0 as KubeFramework 22import org.kube.framework.domain 1.0 as KubeFramework
23 23
24ComboBox { 24/*
25 model: KubeFramework.AccountsModel { } 25 C omboBox { ** *
26 textRole: "name" 26 model: KubeFramework.AccountsModel { }
27 textRole: "name"
28 } */
29
30Button {
31 id: accountSwitcher
32
33 Layout.fillWidth: true
34 Layout.fillHeight: true
35
36 text: "Account Switcher"
37
38 Rectangle {
39 anchors {
40 top: parent.bottom
41 left: parent.left
42 }
43
44 height: 300
45 width: 600
46
47 color: "lightgrey" //FIXME create a propper dialog thingy
48 clip: true
49
50 Item {
51 id: footer
52
53 anchors {
54 bottom: parent.bottom
55 left: parent.left
56 right: parent.right
57 margins: Kirigami.Units.largeSpacing
58 }
59
60 height: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 1
61 width: listView.width
62
63 Button {
64
65 anchors {
66 verticalCenter: parent.verticalCenter
67 right: parent.right
68 }
69
70 text: "Create new Account"
71 }
72
73 Button {
74
75 anchors {
76 verticalCenter: parent.verticalCenter
77 left: parent.left
78 }
79
80 iconName: "view-refresh"
81 text: "Sync"
82 enabled: syncAction.ready
83
84 onClicked: {
85 syncAction.execute()
86 }
87 }
88 }
89
90 ListView {
91 id: listView
92
93 anchors {
94 top: parent.top
95 bottom: footer.top
96 left: parent.left
97 right: parent.right
98 }
99
100 clip: true
101
102 model: KubeFramework.AccountsModel { }
103
104 delegate: Kirigami.AbstractListItem {
105 id: accountDelegate
106
107 enabled: true
108 supportsMouseEvents: true
109
110 contentItem: Item {
111 height: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 1
112 width: listView.width
113
114 RowLayout {
115 anchors {
116 left: parent.left
117 margins: Kirigami.Units.smallSpacing
118 }
119
120 Layout.fillHeight: true
121
122
123 KubeFramework.AccountFactory {
124 id: accountFactory
125 accountId: model.accountId
126 }
127
128 Kirigami.Icon {
129 source: accountFactory.icon
130 }
131
132 Label {
133 text: model.name === "" ? accountFactory.name : model.name
134 }
135 }
136 Button {
137
138 anchors {
139 right: parent.right
140 margins: Kirigami.Units.largeSpacing
141 }
142
143 visible: accountDelegate.containsMouse
144 text: "edit"
145 }
146 }
147 }
148 }
149 }
27} \ No newline at end of file 150} \ No newline at end of file