Merge lp:~renatofilho/address-book-app/fix-1213975 into lp:address-book-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Bill Filler
Approved revision: 86
Merged at revision: 82
Proposed branch: lp:~renatofilho/address-book-app/fix-1213975
Merge into: lp:address-book-app
Diff against target: 237 lines (+103/-22)
5 files modified
src/imports/Common/ContactDetailBase.qml (+7/-0)
src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml (+1/-0)
src/imports/ContactEdit/ContactDetailWithTypeEditor.qml (+7/-1)
src/imports/ContactEdit/ValueSelector.qml (+67/-13)
src/imports/Ubuntu/Contacts/ContactSimpleListView.qml (+21/-8)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/fix-1213975
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+187946@code.launchpad.net

Commit message

* Added a animation when closing the type selector.
* Force focus on InputField when clicking on the type selector.
* Highlight the editable item on contact edit page.
* Added a margin for field details.

To post a comment you must log in.
85. By Renato Araujo Oliveira Filho

Updated selected item visual based on design spec.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
86. By Renato Araujo Oliveira Filho

Adjust ValueSelector animation.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

works

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/imports/Common/ContactDetailBase.qml'
2--- src/imports/Common/ContactDetailBase.qml 2013-07-25 20:58:38 +0000
3+++ src/imports/Common/ContactDetailBase.qml 2013-09-27 00:44:29 +0000
4@@ -28,4 +28,11 @@
5
6 highlightWhenPressed: false
7 focus: true
8+
9+ Rectangle {
10+ anchors.fill: parent
11+ opacity: 0.1
12+ visible: root.selected
13+ z: 100
14+ }
15 }
16
17=== modified file 'src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml'
18--- src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml 2013-09-23 19:17:53 +0000
19+++ src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml 2013-09-27 00:44:29 +0000
20@@ -147,6 +147,7 @@
21 fields: root.fields
22 height: implicitHeight
23 width: root.width
24+ selected: activeFocus
25
26 inputMethodHints: root.inputMethodHints
27 onDetailChanged: updateCombo(false)
28
29=== modified file 'src/imports/ContactEdit/ContactDetailWithTypeEditor.qml'
30--- src/imports/ContactEdit/ContactDetailWithTypeEditor.qml 2013-09-20 13:01:16 +0000
31+++ src/imports/ContactEdit/ContactDetailWithTypeEditor.qml 2013-09-27 00:44:29 +0000
32@@ -78,7 +78,7 @@
33 active: root.active
34 anchors {
35 left: parent.left
36- leftMargin: units.gu(2)
37+ leftMargin: units.gu(3)
38 right: parent.right
39 rightMargin: units.gu(2)
40 top: parent.top
41@@ -86,6 +86,12 @@
42 }
43
44 height: root.active ? units.gu(4) : units.gu(3)
45+ onExpandedChanged: {
46+ // Make sure that the inputfield get focus when clicking on type selector
47+ if (expanded) {
48+ root.forceActiveFocus()
49+ }
50+ }
51 }
52
53 Column {
54
55=== modified file 'src/imports/ContactEdit/ValueSelector.qml'
56--- src/imports/ContactEdit/ValueSelector.qml 2013-09-12 23:22:06 +0000
57+++ src/imports/ContactEdit/ValueSelector.qml 2013-09-27 00:44:29 +0000
58@@ -23,9 +23,9 @@
59 property bool active: false
60 property alias values: listView.model
61 property alias currentIndex: listView.currentIndex
62- property bool expanded: false
63+ readonly property bool expanded: state === "expanded"
64 readonly property alias text: label.text
65- onExpandedChanged: expanded && timer.start()
66+
67
68 function selectItem(text) {
69 for(var i=0; i < values.length; i++) {
70@@ -37,6 +37,8 @@
71 currentIndex = -1
72 }
73
74+ onExpandedChanged: expanded && timer.start()
75+
76 // FIXME: workaround to close list after a while.
77 // we cant rely on focus since it hides the keyboard.
78 MouseArea {
79@@ -53,15 +55,20 @@
80 Timer {
81 id: timer
82 interval: 5000
83- onTriggered: expanded = false
84+ onTriggered: state = ""
85 running: false
86 }
87
88 Item {
89-
90- visible: !expanded
91- anchors.fill: parent
92-
93+ id: title
94+
95+ anchors {
96+ top: parent.top
97+ bottom: parent.bottom
98+ }
99+ Behavior on x {
100+ UbuntuNumberAnimation { }
101+ }
102 Label {
103 id: label
104
105@@ -94,20 +101,22 @@
106 color: "#f3f3e7"
107 opacity: 0.2
108 }
109+ }
110
111- MouseArea {
112- anchors.fill: label
113- propagateComposedEvents: true
114- onClicked: expanded = true
115- }
116+ MouseArea {
117+ anchors.fill: parent
118+ propagateComposedEvents: true
119+ onClicked: root.state = "expanded"
120 }
121
122 ListView {
123 id: listView
124
125 anchors.fill: parent
126+ clip: true
127 orientation: ListView.Horizontal
128- visible: expanded
129+ visible: !title.visible
130+ snapMode: ListView.SnapToItem
131
132 delegate: Item {
133 anchors {
134@@ -157,4 +166,49 @@
135 }
136 }
137 }
138+
139+ transitions: [
140+ Transition {
141+ to: "expanded"
142+ SequentialAnimation {
143+ UbuntuNumberAnimation {
144+ target: title
145+ property: "x"
146+ to: (listView.currentItem.x - listView.contentX)
147+ }
148+ PropertyAction {
149+ target: title
150+ property: "visible"
151+ value: false
152+ }
153+ UbuntuNumberAnimation {
154+ target: listView
155+ property: "opacity"
156+ from: 0.0
157+ to: 1.0
158+ }
159+ }
160+ },
161+ Transition {
162+ to: ""
163+ SequentialAnimation {
164+ UbuntuNumberAnimation {
165+ target: listView
166+ property: "opacity"
167+ from: 1.0
168+ to: 0.0
169+ }
170+ PropertyAction {
171+ target: title
172+ property: "visible"
173+ value: true
174+ }
175+ UbuntuNumberAnimation {
176+ target: title
177+ property: "x"
178+ to: 0
179+ }
180+ }
181+ }
182+ ]
183 }
184
185=== modified file 'src/imports/Ubuntu/Contacts/ContactSimpleListView.qml'
186--- src/imports/Ubuntu/Contacts/ContactSimpleListView.qml 2013-09-26 14:39:08 +0000
187+++ src/imports/Ubuntu/Contacts/ContactSimpleListView.qml 2013-09-27 00:44:29 +0000
188@@ -342,6 +342,7 @@
189 left: avatar.right
190 leftMargin: units.gu(2)
191 verticalCenter: parent.verticalCenter
192+ right: selectionMark.left
193 }
194 Label {
195 id: name
196@@ -358,6 +359,26 @@
197 }
198 }
199
200+ Rectangle {
201+ id: selectionMark
202+
203+ anchors {
204+ top: parent.top
205+ bottom: parent.bottom
206+ right: parent.right
207+ }
208+
209+ color: "black"
210+ width: delegate.selected ? units.gu(5) : 0
211+ visible: width > 0
212+ Icon {
213+ name: "select"
214+ height: units.gu(3)
215+ width: height
216+ anchors.centerIn: parent
217+ }
218+ }
219+
220 onClicked: {
221 if (contactListView.isInSelectionMode) {
222 if (!contactListView.selectItem(item.itemDelegate)) {
223@@ -393,14 +414,6 @@
224 contactsModel.removeContact(contact.contactId)
225 }
226
227- //WORKAROUND: The theme should paint the correct color when the item is selected
228- Rectangle {
229- color: UbuntuColors.orange
230- anchors.fill: parent
231- opacity: 0.5
232- visible: delegate.selected
233- }
234-
235 backgroundIndicator: Rectangle {
236 anchors.fill: parent
237 color: Theme.palette.selected.base

Subscribers

People subscribed via source and target branches