summaryrefslogtreecommitdiffstats
path: root/framework
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-07-21 06:19:56 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-07-21 06:19:56 +0200
commit6c20f4ca0f92ca5a208ca567e7a9cf28df743bf7 (patch)
tree04c7e2a7f16a53034614020d4198760816cc69b2 /framework
parent2853be3b7ff69e39e0b79db4b3ef4eb42b135b34 (diff)
downloadkube-6c20f4ca0f92ca5a208ca567e7a9cf28df743bf7.tar.gz
kube-6c20f4ca0f92ca5a208ca567e7a9cf28df743bf7.zip
Use a Button for the Addressbook delegate.
This makes it keyboard selectable.
Diffstat (limited to 'framework')
-rw-r--r--framework/qml/People.qml85
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 }