diff options
-rw-r--r-- | framework/qml/People.qml | 85 |
1 files changed, 42 insertions, 43 deletions
diff --git a/framework/qml/People.qml b/framework/qml/People.qml index 42c95d78..d0f7d252 100644 --- a/framework/qml/People.qml +++ b/framework/qml/People.qml | |||
@@ -98,6 +98,7 @@ Item { | |||
98 | 98 | ||
99 | anchors.fill: parent | 99 | anchors.fill: parent |
100 | 100 | ||
101 | activeFocusOnTab: true | ||
101 | ScrollBar.vertical: ScrollBar { } | 102 | ScrollBar.vertical: ScrollBar { } |
102 | contentHeight: content.height | 103 | contentHeight: content.height |
103 | clip: true | 104 | clip: true |
@@ -133,65 +134,63 @@ Item { | |||
133 | filter: searchBar.text | 134 | filter: searchBar.text |
134 | } | 135 | } |
135 | 136 | ||
136 | delegate: Rectangle { | 137 | //TODO using Kube.Button currently crashes, but shouldn't |
138 | delegate: Button { | ||
137 | id: delegateRoot | 139 | id: delegateRoot |
138 | 140 | ||
139 | height: Kube.Units.gridUnit * 3 | 141 | height: Kube.Units.gridUnit * 3 |
140 | width: Kube.Units.gridUnit * 10 | 142 | width: Kube.Units.gridUnit * 10 |
141 | 143 | ||
142 | border.width: 1 | 144 | activeFocusOnTab: true |
143 | border.color: "lightgrey" | 145 | Keys.onReturnPressed: delegateRoot.clicked() |
144 | 146 | ||
145 | MouseArea { | 147 | onClicked: { |
146 | anchors.fill: parent | 148 | root.currentContact = model.domainObject |
147 | 149 | stack.push(personPage) | |
148 | onClicked: { | ||
149 | root.currentContact = model.domainObject | ||
150 | stack.push(personPage) | ||
151 | } | ||
152 | } | 150 | } |
153 | 151 | ||
154 | Rectangle { | 152 | contentItem: Item { |
155 | id: avatarPlaceholder | 153 | anchors.fill: parent |
156 | 154 | Item { | |
157 | height: parent.height | 155 | id: avatarPlaceholder |
158 | width: height | 156 | |
159 | Kube.KubeImage { | 157 | height: parent.height |
160 | anchors.fill: parent | 158 | width: height |
161 | visible: model.imageData != "" | 159 | Kube.KubeImage { |
162 | imageData: model.imageData | 160 | anchors.fill: parent |
163 | } | 161 | visible: model.imageData != "" |
164 | Kube.Icon { | 162 | imageData: model.imageData |
165 | anchors.fill: parent | 163 | } |
166 | visible: model.imageData == "" | 164 | Kube.Icon { |
167 | iconName: Kube.Icons.user | 165 | anchors.fill: parent |
166 | visible: model.imageData == "" | ||
167 | iconName: Kube.Icons.user | ||
168 | } | ||
168 | } | 169 | } |
169 | color: "lightgrey" | ||
170 | } | ||
171 | 170 | ||
171 | Column { | ||
172 | 172 | ||
173 | Column { | 173 | width: parent.width |
174 | 174 | ||
175 | width: parent.width | 175 | anchors { |
176 | left: avatarPlaceholder.right | ||
177 | margins: Kube.Units.smallSpacing | ||
178 | verticalCenter: parent.verticalCenter | ||
179 | } | ||
176 | 180 | ||
177 | anchors { | 181 | Kube.Label { |
178 | left: avatarPlaceholder.right | 182 | width: delegateRoot.width - avatarPlaceholder.width - Kube.Units.smallSpacing * 2 |
179 | margins: Kube.Units.smallSpacing | ||
180 | verticalCenter: parent.verticalCenter | ||
181 | } | ||
182 | 183 | ||
183 | Kube.Label { | 184 | text: model.firstName |
184 | width: delegateRoot.width - avatarPlaceholder.width - Kube.Units.smallSpacing * 2 | 185 | elide: Text.ElideRight |
185 | 186 | } | |
186 | text: model.firstName | ||
187 | elide: Text.ElideRight | ||
188 | } | ||
189 | 187 | ||
190 | Kube.Label { | 188 | Kube.Label { |
191 | width: delegateRoot.width - avatarPlaceholder.width - Kube.Units.smallSpacing * 2 | 189 | width: delegateRoot.width - avatarPlaceholder.width - Kube.Units.smallSpacing * 2 |
192 | 190 | ||
193 | text: model.lastName | 191 | text: model.lastName |
194 | elide: Text.ElideRight | 192 | elide: Text.ElideRight |
193 | } | ||
195 | } | 194 | } |
196 | } | 195 | } |
197 | } | 196 | } |