Merge lp:~tiagosh/address-book-app/fix-delegate-size into lp:address-book-app

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 56
Merged at revision: 56
Proposed branch: lp:~tiagosh/address-book-app/fix-delegate-size
Merge into: lp:address-book-app
Diff against target: 273 lines (+127/-33)
8 files modified
src/imports/ContactEdit/ContactDetailAddressesEditor.qml (+1/-1)
src/imports/ContactEdit/ContactDetailWithTypeEditor.qml (+8/-0)
src/imports/ContactEdit/ContactEditor.qml (+6/-0)
src/imports/ContactEdit/TextInputDetail.qml (+2/-0)
src/imports/ContactView/ContactView.qml (+1/-1)
src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml (+58/-25)
src/imports/Ubuntu/Contacts/ContactListView.qml (+2/-0)
src/imports/Ubuntu/Contacts/ContactSimpleListView.qml (+49/-6)
To merge this branch: bzr merge lp:~tiagosh/address-book-app/fix-delegate-size
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+182712@code.launchpad.net

Commit message

- Fix bugs 1217520, 1211712 and 1217526
- Update visuals to match design spec

Description of the change

- Fix bugs 1217520, 1211712 and 1217526
- Update visuals to match design spec

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Looks good and works as expected.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/imports/ContactEdit/ContactDetailAddressesEditor.qml'
2--- src/imports/ContactEdit/ContactDetailAddressesEditor.qml 2013-07-25 21:16:28 +0000
3+++ src/imports/ContactEdit/ContactDetailAddressesEditor.qml 2013-08-28 17:11:16 +0000
4@@ -32,5 +32,5 @@
5 i18n.tr("Locality"),
6 i18n.tr("Region"),
7 i18n.tr("Post code"),
8- i18n.tr("Cuntry") ]
9+ i18n.tr("Country") ]
10 }
11
12=== modified file 'src/imports/ContactEdit/ContactDetailWithTypeEditor.qml'
13--- src/imports/ContactEdit/ContactDetailWithTypeEditor.qml 2013-07-26 00:19:09 +0000
14+++ src/imports/ContactEdit/ContactDetailWithTypeEditor.qml 2013-08-28 17:11:16 +0000
15@@ -95,6 +95,14 @@
16
17 focus: true
18 TextInputDetail {
19+ id: detail
20+ Component.onCompleted: {
21+ if (index == 0) {
22+ focus = true
23+ detail.forceActiveFocus()
24+ }
25+ }
26+ focus: false
27 detail: root.detail
28 field: modelData
29 placeholderText: root.placeholderTexts[index]
30
31=== modified file 'src/imports/ContactEdit/ContactEditor.qml'
32--- src/imports/ContactEdit/ContactEditor.qml 2013-08-07 18:57:30 +0000
33+++ src/imports/ContactEdit/ContactEditor.qml 2013-08-28 17:11:16 +0000
34@@ -27,6 +27,12 @@
35
36 property QtObject activeItem: null
37
38+ // we use a custom toolbar in this view
39+ tools: ToolbarItems {
40+ locked: true
41+ opened: false
42+ }
43+
44 function save() {
45 var changed = false
46 for(var i = 0; i < contents.children.length; ++i) {
47
48=== modified file 'src/imports/ContactEdit/TextInputDetail.qml'
49--- src/imports/ContactEdit/TextInputDetail.qml 2013-07-25 21:47:36 +0000
50+++ src/imports/ContactEdit/TextInputDetail.qml 2013-08-28 17:11:16 +0000
51@@ -29,6 +29,8 @@
52
53 signal removeClicked()
54
55+ Component.onCompleted: makeMeVisible(root)
56+
57 focus: true
58 text: originalValue ? originalValue : ""
59 style: TextFieldStyle {
60
61=== modified file 'src/imports/ContactView/ContactView.qml'
62--- src/imports/ContactView/ContactView.qml 2013-07-26 15:56:16 +0000
63+++ src/imports/ContactView/ContactView.qml 2013-08-28 17:11:16 +0000
64@@ -33,7 +33,7 @@
65
66 if (contact.name) {
67 var detail = contact.name
68- return detail.firstName + "\n" + detail.lastName
69+ return detail.firstName +" " + detail.lastName
70 } else if (contact.displayLabel && contact.displayLabel.label && contact.displayLabel.label !== "") {
71 return contact.displayLabel.label
72 } else {
73
74=== modified file 'src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml'
75--- src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml 2013-08-01 01:15:45 +0000
76+++ src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml 2013-08-28 17:11:16 +0000
77@@ -27,40 +27,73 @@
78 id: phoneTypeModel
79 }
80
81- height: details.height
82+ height: details.height + units.gu(2)
83 anchors {
84 left: parent.left
85 right: parent.right
86 }
87
88- Column {
89+ UbuntuShape {
90 id: details
91- anchors.top: parent.top
92 height: childrenRect.height
93- width: parent.width
94-
95- Repeater {
96- model: contact ? contact.phoneNumbers : undefined
97- ListItem.Empty {
98- Column {
99- anchors.verticalCenter: parent.verticalCenter
100- anchors.left: parent.left
101- anchors.right: parent.right
102- anchors.leftMargin: units.gu(2)
103- anchors.rightMargin: units.gu(2)
104- Label {
105- id: context
106- text: phoneTypeModel.get(phoneTypeModel.getTypeIndex(modelData)).label
107- fontSize: "small"
108- color: "#a3a3a3"
109- }
110- Label {
111- text: number
112- fontSize: "large"
113+ color: Qt.rgba(0,0,0,0.1)
114+ anchors {
115+ top: parent.top
116+ //topMargin: units.gu(2)
117+ left: parent.left
118+ leftMargin: units.gu(2)
119+ right: parent.right
120+ rightMargin: units.gu(2)
121+ }
122+
123+ Column {
124+ id: detailItems
125+ anchors.top: parent.top
126+ height: childrenRect.height
127+ width: parent.width
128+
129+ Repeater {
130+ model: contact ? contact.phoneNumbers : undefined
131+ ListItem.Empty {
132+ showDivider: false
133+ Column {
134+ anchors.verticalCenter: parent.verticalCenter
135+ anchors.left: parent.left
136+ anchors.right: parent.right
137+ anchors.leftMargin: units.gu(2)
138+ anchors.rightMargin: units.gu(2)
139+ Label {
140+ id: context
141+ text: phoneTypeModel.get(phoneTypeModel.getTypeIndex(modelData)).label
142+ fontSize: "small"
143+ opacity: 0.2
144+ }
145+ Label {
146+ text: number
147+ fontSize: "medium"
148+ }
149+ }
150+
151+ onClicked: detailClicked(modelData)
152+ Image {
153+ height: units.gu(3)
154+ width: units.gu(3)
155+ source: "../assets/dialer_call.png"
156+ fillMode: Image.PreserveAspectFit
157+ anchors {
158+ right: parent.right
159+ verticalCenter: parent.verticalCenter
160+ }
161+ }
162+ ListItem.ThinDivider {
163+ visible: index != 0
164+ anchors {
165+ bottom: parent.top
166+ right: parent.right
167+ left: parent.left
168+ }
169 }
170 }
171-
172- onClicked: detailClicked(modelData)
173 }
174 }
175 }
176
177=== modified file 'src/imports/Ubuntu/Contacts/ContactListView.qml'
178--- src/imports/Ubuntu/Contacts/ContactListView.qml 2013-08-08 23:04:47 +0000
179+++ src/imports/Ubuntu/Contacts/ContactListView.qml 2013-08-28 17:11:16 +0000
180@@ -47,6 +47,7 @@
181
182 ContactSimpleListView {
183 header: ListItem.Header {
184+ height: units.gu(5)
185 text: i18n.tr("Favourites")
186 }
187
188@@ -79,6 +80,7 @@
189 }
190 }
191 ListItem.Header {
192+ height: units.gu(5)
193 text: i18n.tr("All contacts")
194 }
195 }
196
197=== modified file 'src/imports/Ubuntu/Contacts/ContactSimpleListView.qml'
198--- src/imports/Ubuntu/Contacts/ContactSimpleListView.qml 2013-08-27 17:13:04 +0000
199+++ src/imports/Ubuntu/Contacts/ContactSimpleListView.qml 2013-08-28 17:11:16 +0000
200@@ -223,17 +223,52 @@
201 }
202 }
203
204- ListItem.Subtitled {
205+ ListItem.Empty {
206 id: delegate
207 property bool detailsShown: false
208+ height: units.gu(10)
209+ showDivider : false
210
211 selected: contactListView.multiSelectionEnabled && contactListView.isSelected(item)
212 removable: contactListView.swipeToDelete && !detailsShown && !isInSelectionMode
213- icon: contactListView.showAvatar && contact && contact.avatar && (contact.avatar.imageUrl != "") ?
214- Qt.resolvedUrl(contact.avatar.imageUrl) :
215- contactListView.defaultAvatarImageUrl
216- text: contactListView.formatToDisplay(contact, contactListView.titleDetail, contactListView.titleFields)
217- subText: contactListView.formatToDisplay(contact, contactListView.subTitleDetail, contactListView.subTitleFields)
218+ UbuntuShape {
219+ id: avatar
220+ height: units.gu(7)
221+ width: units.gu(7)
222+ anchors {
223+ left: parent.left
224+ leftMargin: units.gu(2)
225+ verticalCenter: parent.verticalCenter
226+ }
227+ image: Image {
228+
229+ source: contactListView.showAvatar && contact && contact.avatar && (contact.avatar.imageUrl != "") ?
230+ Qt.resolvedUrl(contact.avatar.imageUrl) :
231+ contactListView.defaultAvatarImageUrl
232+ }
233+ }
234+
235+ Row {
236+ spacing: units.gu(1)
237+ anchors {
238+ left: avatar.right
239+ leftMargin: units.gu(2)
240+ verticalCenter: parent.verticalCenter
241+ }
242+ Label {
243+ id: name
244+ height: paintedHeight
245+ text: contactListView.formatToDisplay(contact, contactListView.titleDetail, contactListView.titleFields)
246+ fontSize: "large"
247+ }
248+ Label {
249+ id: company
250+ height: paintedHeight
251+ text: contactListView.formatToDisplay(contact, contactListView.subTitleDetail, contactListView.subTitleFields)
252+ fontSize: "medium"
253+ opacity: 0.2
254+ }
255+ }
256
257 onClicked: {
258 if (contactListView.isInSelectionMode) {
259@@ -313,6 +348,14 @@
260 }
261 }
262 }
263+ ListItem.ThinDivider {
264+ anchors {
265+ bottom: pickerLoader.bottom
266+ right: parent.right
267+ left: parent.left
268+ }
269+ }
270+
271 Connections {
272 target: pickerLoader.item
273 onDetailClicked: detailClicked(contact, detail)

Subscribers

People subscribed via source and target branches