diff options
author | Michael Bohlender <michael.bohlender@kdemail.net> | 2018-01-19 11:00:40 +0100 |
---|---|---|
committer | Michael Bohlender <michael.bohlender@kdemail.net> | 2018-01-19 11:00:40 +0100 |
commit | e4b05fe7f410fac61e28ae8dc44c6cdda280e728 (patch) | |
tree | a8db7a96e3ced110e6c70d853c02fa1ef7074e4e | |
parent | 908f7c4ac1396ec6b27b921b93c6987d65b2409c (diff) | |
download | kube-e4b05fe7f410fac61e28ae8dc44c6cdda280e728.tar.gz kube-e4b05fe7f410fac61e28ae8dc44c6cdda280e728.zip |
extract personpage from people
-rw-r--r-- | framework/qml/People.qml | 175 | ||||
-rw-r--r-- | framework/qml/PersonPage.qml | 238 | ||||
-rw-r--r-- | framework/qmldir | 1 |
3 files changed, 244 insertions, 170 deletions
diff --git a/framework/qml/People.qml b/framework/qml/People.qml index b58599a1..1a08d900 100644 --- a/framework/qml/People.qml +++ b/framework/qml/People.qml | |||
@@ -215,167 +215,11 @@ FocusScope { | |||
215 | 215 | ||
216 | color: Kube.Colors.viewBackgroundColor | 216 | color: Kube.Colors.viewBackgroundColor |
217 | 217 | ||
218 | Flickable { | 218 | PersonPage { |
219 | id: personPageFlickable | 219 | } |
220 | 220 | } | |
221 | anchors { | 221 | } |
222 | fill: parent | 222 | } |
223 | leftMargin: Kube.Units.largeSpacing | ||
224 | } | ||
225 | |||
226 | Controls2.ScrollBar.vertical: Kube.ScrollBar { } | ||
227 | contentHeight: contentColumn.height | ||
228 | |||
229 | clip: true | ||
230 | |||
231 | Kube.ScrollHelper { | ||
232 | flickable: personPageFlickable | ||
233 | anchors.fill: parent | ||
234 | } | ||
235 | |||
236 | ColumnLayout { | ||
237 | id: contentColumn | ||
238 | |||
239 | anchors { | ||
240 | left: parent.left | ||
241 | right: parent.right | ||
242 | } | ||
243 | |||
244 | spacing: Kube.Units.largeSpacing | ||
245 | |||
246 | Item { | ||
247 | width: parent.width | ||
248 | height: Kube.Units.smallSpacing | ||
249 | } | ||
250 | |||
251 | Item { | ||
252 | |||
253 | height: Kube.Units.gridUnit * 8 | ||
254 | width: personPageRoot.width - Kube.Units.largeSpacing | ||
255 | |||
256 | Rectangle { | ||
257 | id: avatar | ||
258 | |||
259 | height: parent.height | ||
260 | width: height | ||
261 | Kube.KubeImage { | ||
262 | anchors.fill: parent | ||
263 | visible: contactController.imageData != "" | ||
264 | imageData: contactController.imageData | ||
265 | } | ||
266 | Kube.Icon { | ||
267 | anchors.fill: parent | ||
268 | visible: contactController.imageData == "" | ||
269 | iconName: Kube.Icons.user | ||
270 | } | ||
271 | color: Kube.Colors.buttonColor | ||
272 | } | ||
273 | |||
274 | Kube.Heading { | ||
275 | id: nameLabel | ||
276 | |||
277 | anchors { | ||
278 | top: avatar.top | ||
279 | left: avatar.right | ||
280 | leftMargin: Kube.Units.largeSpacing | ||
281 | } | ||
282 | |||
283 | text: contactController.name | ||
284 | } | ||
285 | |||
286 | Kube.Label { | ||
287 | id: jobTitle | ||
288 | |||
289 | anchors { | ||
290 | top: nameLabel.bottom | ||
291 | left: avatar.right | ||
292 | leftMargin: Kube.Units.largeSpacing | ||
293 | } | ||
294 | |||
295 | text: contactController.jobTitle | ||
296 | } | ||
297 | |||
298 | Rectangle { | ||
299 | id: company | ||
300 | visible: contactController.company != "" | ||
301 | |||
302 | anchors { | ||
303 | bottom: avatar.bottom | ||
304 | left: avatar.right | ||
305 | leftMargin: Kube.Units.largeSpacing | ||
306 | } | ||
307 | |||
308 | height: Kube.Units.gridUnit * 3 | ||
309 | width: Kube.Units.gridUnit * 10 | ||
310 | |||
311 | border.width: 1 | ||
312 | border.color: Kube.Colors.buttonColor | ||
313 | |||
314 | Rectangle { | ||
315 | id: av | ||
316 | |||
317 | height: parent.height | ||
318 | width: height | ||
319 | |||
320 | color: Kube.Colors.buttonColor | ||
321 | } | ||
322 | |||
323 | Kube.Label { | ||
324 | anchors { | ||
325 | verticalCenter: av.verticalCenter | ||
326 | left: av.right | ||
327 | leftMargin: Kube.Units.smallSpacing | ||
328 | } | ||
329 | |||
330 | text: contactController.company | ||
331 | } | ||
332 | } | ||
333 | } | ||
334 | |||
335 | Flow { | ||
336 | id: emails | ||
337 | |||
338 | width: personPageRoot.width - Kube.Units.largeSpacing | ||
339 | |||
340 | Repeater { | ||
341 | model: contactController.emails | ||
342 | |||
343 | delegate: Row { | ||
344 | spacing: Kube.Units.smallSpacing | ||
345 | Kube.Label { text: qsTr("(main)") } | ||
346 | Kube.Label { text: modelData ; color: Kube.Colors.highlightColor } | ||
347 | Item { width: Kube.Units.smallSpacing; height: 1 } | ||
348 | } | ||
349 | } | ||
350 | } | ||
351 | |||
352 | Flow { | ||
353 | id: phone | ||
354 | |||
355 | width: personPageRoot.width - Kube.Units.largeSpacing | ||
356 | spacing: Kube.Units.smallSpacing | ||
357 | |||
358 | Repeater { | ||
359 | model: contactController.phoneNumbers | ||
360 | |||
361 | Row { | ||
362 | spacing: Kube.Units.smallSpacing | ||
363 | Kube.Label { text: qsTr("(main)") } | ||
364 | Kube.Label { text: modelData ; opacity: 0.6 } | ||
365 | Item { width: Kube.Units.smallSpacing; height: 1 } | ||
366 | } | ||
367 | } | ||
368 | } | ||
369 | |||
370 | Column { | ||
371 | id: address | ||
372 | |||
373 | width: personPageRoot.width - Kube.Units.largeSpacing | ||
374 | |||
375 | Kube.Label { text: contactController.street } | ||
376 | Kube.Label { text: contactController.city } | ||
377 | Kube.Label { text: contactController.country } | ||
378 | } | ||
379 | 223 | ||
380 | // Column { | 224 | // Column { |
381 | // | 225 | // |
@@ -418,12 +262,3 @@ FocusScope { | |||
418 | // } | 262 | // } |
419 | // } | 263 | // } |
420 | 264 | ||
421 | Item { | ||
422 | width: parent.width | ||
423 | height: Kube.Units.largeSpacing | ||
424 | } | ||
425 | } | ||
426 | } | ||
427 | } | ||
428 | } | ||
429 | } | ||
diff --git a/framework/qml/PersonPage.qml b/framework/qml/PersonPage.qml new file mode 100644 index 00000000..cd2a5d65 --- /dev/null +++ b/framework/qml/PersonPage.qml | |||
@@ -0,0 +1,238 @@ | |||
1 | /* | ||
2 | Copyright (C) 2017 Michael Bohlender, <bohlender@kolabsys.com> | ||
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 | import QtQuick 2.7 | ||
21 | import QtQuick.Controls 2.0 as Controls2 | ||
22 | import QtQuick.Layouts 1.1 | ||
23 | |||
24 | import org.kube.framework 1.0 as Kube | ||
25 | |||
26 | |||
27 | Flickable { | ||
28 | id: personPageFlickable | ||
29 | |||
30 | anchors { | ||
31 | fill: parent | ||
32 | leftMargin: Kube.Units.largeSpacing | ||
33 | } | ||
34 | |||
35 | Controls2.ScrollBar.vertical: Kube.ScrollBar { } | ||
36 | contentHeight: contentColumn.height | ||
37 | |||
38 | clip: true | ||
39 | |||
40 | Kube.ScrollHelper { | ||
41 | flickable: personPageFlickable | ||
42 | anchors.fill: parent | ||
43 | } | ||
44 | |||
45 | |||
46 | ColumnLayout { | ||
47 | id: contentColumn | ||
48 | |||
49 | anchors { | ||
50 | left: parent.left | ||
51 | right: parent.right | ||
52 | } | ||
53 | |||
54 | spacing: Kube.Units.largeSpacing | ||
55 | |||
56 | Item { | ||
57 | width: parent.width | ||
58 | height: Kube.Units.smallSpacing | ||
59 | } | ||
60 | |||
61 | |||
62 | Item { | ||
63 | |||
64 | height: Kube.Units.gridUnit * 8 | ||
65 | width: personPageRoot.width - Kube.Units.largeSpacing | ||
66 | |||
67 | Rectangle { | ||
68 | id: avatar | ||
69 | |||
70 | height: parent.height | ||
71 | width: height | ||
72 | Kube.KubeImage { | ||
73 | anchors.fill: parent | ||
74 | visible: contactController.imageData != "" | ||
75 | imageData: contactController.imageData | ||
76 | } | ||
77 | Kube.Icon { | ||
78 | anchors.fill: parent | ||
79 | visible: contactController.imageData == "" | ||
80 | iconName: Kube.Icons.user | ||
81 | } | ||
82 | color: Kube.Colors.buttonColor | ||
83 | } | ||
84 | |||
85 | Kube.Heading { | ||
86 | id: nameLabel | ||
87 | |||
88 | anchors { | ||
89 | top: avatar.top | ||
90 | left: avatar.right | ||
91 | leftMargin: Kube.Units.largeSpacing | ||
92 | } | ||
93 | |||
94 | text: contactController.name | ||
95 | } | ||
96 | |||
97 | Kube.Label { | ||
98 | id: jobTitle | ||
99 | |||
100 | anchors { | ||
101 | top: nameLabel.bottom | ||
102 | left: avatar.right | ||
103 | leftMargin: Kube.Units.largeSpacing | ||
104 | } | ||
105 | |||
106 | text: contactController.jobTitle | ||
107 | } | ||
108 | |||
109 | Rectangle { | ||
110 | id: company | ||
111 | visible: contactController.company != "" | ||
112 | |||
113 | anchors { | ||
114 | bottom: avatar.bottom | ||
115 | left: avatar.right | ||
116 | leftMargin: Kube.Units.largeSpacing | ||
117 | } | ||
118 | |||
119 | height: Kube.Units.gridUnit * 3 | ||
120 | width: Kube.Units.gridUnit * 10 | ||
121 | |||
122 | border.width: 1 | ||
123 | border.color: Kube.Colors.buttonColor | ||
124 | |||
125 | Rectangle { | ||
126 | id: av | ||
127 | |||
128 | height: parent.height | ||
129 | width: height | ||
130 | |||
131 | color: Kube.Colors.buttonColor | ||
132 | } | ||
133 | |||
134 | Kube.Label { | ||
135 | anchors { | ||
136 | verticalCenter: av.verticalCenter | ||
137 | left: av.right | ||
138 | leftMargin: Kube.Units.smallSpacing | ||
139 | } | ||
140 | |||
141 | text: contactController.company | ||
142 | } | ||
143 | } | ||
144 | } | ||
145 | |||
146 | Flow { | ||
147 | id: emails | ||
148 | |||
149 | width: personPageRoot.width - Kube.Units.largeSpacing | ||
150 | |||
151 | Repeater { | ||
152 | model: contactController.emails | ||
153 | |||
154 | delegate: Row { | ||
155 | spacing: Kube.Units.smallSpacing | ||
156 | Kube.Label { text: qsTr("(main)") } | ||
157 | Kube.Label { text: modelData ; color: Kube.Colors.highlightColor } | ||
158 | Item { width: Kube.Units.smallSpacing; height: 1 } | ||
159 | } | ||
160 | } | ||
161 | } | ||
162 | |||
163 | Flow { | ||
164 | id: phone | ||
165 | |||
166 | width: personPageRoot.width - Kube.Units.largeSpacing | ||
167 | spacing: Kube.Units.smallSpacing | ||
168 | |||
169 | Repeater { | ||
170 | model: contactController.phoneNumbers | ||
171 | |||
172 | Row { | ||
173 | spacing: Kube.Units.smallSpacing | ||
174 | Kube.Label { text: qsTr("(main)") } | ||
175 | Kube.Label { text: modelData ; opacity: 0.6 } | ||
176 | Item { width: Kube.Units.smallSpacing; height: 1 } | ||
177 | } | ||
178 | } | ||
179 | } | ||
180 | |||
181 | Column { | ||
182 | id: address | ||
183 | |||
184 | width: personPageRoot.width - Kube.Units.largeSpacing | ||
185 | |||
186 | Kube.Label { text: contactController.street } | ||
187 | Kube.Label { text: contactController.city } | ||
188 | Kube.Label { text: contactController.country } | ||
189 | } | ||
190 | Item { | ||
191 | width: parent.width | ||
192 | height: Kube.Units.largeSpacing | ||
193 | } | ||
194 | } | ||
195 | } | ||
196 | |||
197 | // Column { | ||
198 | // | ||
199 | // width: parent.width | ||
200 | // | ||
201 | // spacing: Kube.Units.smallSpacing | ||
202 | // | ||
203 | // Text { | ||
204 | // | ||
205 | // text: root.firstname + " is part of these groups:" | ||
206 | // } | ||
207 | // | ||
208 | // GroupGrid { | ||
209 | // id: groups | ||
210 | // | ||
211 | // width: root.width - Kube.Units.largeSpacing | ||
212 | // | ||
213 | // model: GroupModel1 {} | ||
214 | // } | ||
215 | // } | ||
216 | |||
217 | // Column { | ||
218 | // | ||
219 | // width: parent.width | ||
220 | // | ||
221 | // spacing: Kube.Units.smallSpacing | ||
222 | // | ||
223 | // Text { | ||
224 | // id: commonPeopleLabel | ||
225 | // | ||
226 | // text: root.firstname + " is associated with:" | ||
227 | // } | ||
228 | // | ||
229 | // PeopleGrid { | ||
230 | // id: commonPeople | ||
231 | // | ||
232 | // width: root.width - Kube.Units.largeSpacing | ||
233 | // | ||
234 | // model: PeopleModel2 {} | ||
235 | // } | ||
236 | // } | ||
237 | |||
238 | |||
diff --git a/framework/qmldir b/framework/qmldir index b94abc28..46628985 100644 --- a/framework/qmldir +++ b/framework/qmldir | |||
@@ -12,6 +12,7 @@ LoginAccount 1.0 LoginAccount.qml | |||
12 | OverlayDialog 1.0 OverlayDialog.qml | 12 | OverlayDialog 1.0 OverlayDialog.qml |
13 | Outbox 1.0 Outbox.qml | 13 | Outbox 1.0 Outbox.qml |
14 | People 1.0 People.qml | 14 | People 1.0 People.qml |
15 | PersonPage 1.0 PersonPage.qml | ||
15 | NotificationPopup 1.0 NotificationPopup.qml | 16 | NotificationPopup 1.0 NotificationPopup.qml |
16 | Icon 1.0 Icon.qml | 17 | Icon 1.0 Icon.qml |
17 | IconButton 1.0 IconButton.qml | 18 | IconButton 1.0 IconButton.qml |