summaryrefslogtreecommitdiffstats
path: root/framework/qml/PersonPage.qml
diff options
context:
space:
mode:
Diffstat (limited to 'framework/qml/PersonPage.qml')
-rw-r--r--framework/qml/PersonPage.qml238
1 files changed, 238 insertions, 0 deletions
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
20import QtQuick 2.7
21import QtQuick.Controls 2.0 as Controls2
22import QtQuick.Layouts 1.1
23
24import org.kube.framework 1.0 as Kube
25
26
27Flickable {
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