Merge lp:~renatofilho/ubuntu-ui-toolkit/fix-1213046 into lp:ubuntu-ui-toolkit

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Bill Filler
Approved revision: 761
Merged at revision: 772
Proposed branch: lp:~renatofilho/ubuntu-ui-toolkit/fix-1213046
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 225 lines (+91/-5)
4 files modified
CHANGES (+1/-0)
components.api (+1/-0)
examples/ubuntu-ui-toolkit-gallery/ListItems.qml (+1/-0)
modules/Ubuntu/Components/ListItems/Empty.qml (+88/-5)
To merge this branch: bzr merge lp:~renatofilho/ubuntu-ui-toolkit/fix-1213046
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Bill Filler (community) Approve
Gustavo Pichorim Boiko (community) Needs Fixing
Review via email: mp+186223@code.launchpad.net

Commit message

Added "confirmRemoval" in ListItem.Empty

This will ask for confirmation before remove the item.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
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 :

32 + Defines if the item need confirmation before remove by swiping

I'm no native English speaker, but I think this should read:

Defines if the item needs confirmation before removing by swiping

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Francis Ginther (fginther) wrote :

It looks like changes introduced by the following MP may have broken this:
https://code.launchpad.net/~zsombi/ubuntu-ui-toolkit/alarm-status/+merge/186285

That MP was merged into trunk just before the build failures started for ubuntu-ui-toolkit-ci/738. It also appears to change the 'alarm' feature which is also implicated by the failure message seen in all the builds:

QQmlComponent: Component is not ready
WARNING: default alarm manager not installed, using "memory" manager.
This manager may not provide all the needed features.

756. By Renato Araujo Oliveira Filho

Merged mainline.

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

Merged mainline.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote :

You need to update components.api.

758. By Renato Araujo Oliveira Filho

Fixed components.api.

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

Updated components.api.

760. By Renato Araujo Oliveira Filho

Updated documentation.

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

Merged mainline.

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

approve

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CHANGES'
--- CHANGES 2013-09-12 13:56:14 +0000
+++ CHANGES 2013-09-30 12:01:05 +0000
@@ -9,6 +9,7 @@
99
10API Changes10API Changes
11***********11***********
12* ADDED IN: ListItem.Empty: property bool confirmRemoval
12* ADDED IN: OptionSelectorDelegate: property bool constrainImage13* ADDED IN: OptionSelectorDelegate: property bool constrainImage
13* ADDED IN: Empty: property alias divider14* ADDED IN: Empty: property alias divider
14* ADDED IN: ListItems/OptionSelector: signal delegateSelected()15* ADDED IN: ListItems/OptionSelector: signal delegateSelected()
1516
=== modified file 'components.api'
--- components.api 2013-09-27 21:17:50 +0000
+++ components.api 2013-09-30 12:01:05 +0000
@@ -401,6 +401,7 @@
401 property bool selected401 property bool selected
402 property bool highlightWhenPressed402 property bool highlightWhenPressed
403 property bool removable403 property bool removable
404 property bool confirmRemoval
404 readonly property string swipingState405 readonly property string swipingState
405 signal itemRemoved406 signal itemRemoved
406 property int __height407 property int __height
407408
=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItems.qml'
--- examples/ubuntu-ui-toolkit-gallery/ListItems.qml 2013-09-03 10:12:39 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ListItems.qml 2013-09-30 12:01:05 +0000
@@ -142,6 +142,7 @@
142 delegate: ListItem.Standard {142 delegate: ListItem.Standard {
143 text: i18n.tr("Slide to remove")143 text: i18n.tr("Slide to remove")
144 removable: true144 removable: true
145 confirmRemoval: (index % 2)
145 backgroundIndicator: Rectangle {146 backgroundIndicator: Rectangle {
146 anchors.fill: parent147 anchors.fill: parent
147 color: Theme.palette.normal.base148 color: Theme.palette.normal.base
148149
=== modified file 'modules/Ubuntu/Components/ListItems/Empty.qml'
--- modules/Ubuntu/Components/ListItems/Empty.qml 2013-09-18 02:26:23 +0000
+++ modules/Ubuntu/Components/ListItems/Empty.qml 2013-09-30 12:01:05 +0000
@@ -97,6 +97,13 @@
9797
98 /*!98 /*!
99 \preliminary99 \preliminary
100 Defines if the item needs confirmation before removing by swiping.
101 \qmlproperty bool confirmRemoval
102 */
103 property alias confirmRemoval: confirmRemovalDialog.visible
104
105 /*!
106 \preliminary
100 \qmlproperty string swipingState107 \qmlproperty string swipingState
101 The current swiping state ("SwipingLeft", "SwipingRight", "")108 The current swiping state ("SwipingLeft", "SwipingRight", "")
102 */109 */
@@ -174,7 +181,7 @@
174 /*! \internal181 /*! \internal
175 Defines the offset limit to consider the item removed182 Defines the offset limit to consider the item removed
176 */183 */
177 readonly property int itemMoveOffset: width * 0.3184 readonly property int itemMoveOffset: confirmRemoval ? width * 0.5 : width * 0.3
178185
179 /*! \internal186 /*! \internal
180 Defines the inital pressed possition187 Defines the inital pressed possition
@@ -211,10 +218,13 @@
211 Resets the item dragging state218 Resets the item dragging state
212 */219 */
213 function resetDrag() {220 function resetDrag() {
221 body.x = 0
214 pressedPosition = -1222 pressedPosition = -1
215 __mouseArea.drag.target = null223 __mouseArea.drag.target = null
216 held = false224 held = false
217 removeItem = false225 removeItem = false
226 backgroundIndicator.opacity = 0.0
227 backgroundIndicator.visible = false
218 backgroundIndicator.state = ""228 backgroundIndicator.state = ""
219 }229 }
220230
@@ -223,7 +233,9 @@
223 */233 */
224 function commitDrag() {234 function commitDrag() {
225 if (removeItem) {235 if (removeItem) {
226 removeItemAnimation.start()236 if (!confirmRemoval) {
237 removeItemAnimation.start()
238 }
227 } else {239 } else {
228 resetDrag()240 resetDrag()
229 }241 }
@@ -244,10 +256,14 @@
244 } else if (held == true) {256 } else if (held == true) {
245 held = false257 held = false
246 removeItem = true258 removeItem = true
259 var finalX = body.width
260 if (emptyListItem.confirmRemoval) {
261 finalX = itemMoveOffset
262 }
247 if (body.x > 0) {263 if (body.x > 0) {
248 body.x = body.width264 body.x = finalX
249 } else {265 } else {
250 body.x = body.width * -1266 body.x = -finalX
251 }267 }
252 }268 }
253 }269 }
@@ -307,6 +323,7 @@
307 id: backgroundIndicator323 id: backgroundIndicator
308324
309 opacity: 0.0325 opacity: 0.0
326 visible: false
310 anchors {327 anchors {
311 left: parent.left328 left: parent.left
312 right: parent.right329 right: parent.right
@@ -314,18 +331,73 @@
314 bottom: parent.bottom331 bottom: parent.bottom
315 }332 }
316333
334 Item {
335 id: confirmRemovalDialog
336
337 width: units.gu(15)
338 anchors {
339 top: parent.top
340 bottom: parent.bottom
341 }
342
343 Row {
344 anchors {
345 top: parent.top
346 bottom: parent.bottom
347 left: parent.left
348 right: parent.right
349 leftMargin: units.gu(2)
350 rightMargin: units.gu(2)
351 }
352
353 spacing: units.gu(2)
354 Image {
355 source: "artwork/delete.png"
356 fillMode: Image.Pad
357 anchors {
358 top: parent.top
359 bottom: parent.bottom
360 }
361 width: units.gu(5)
362 }
363 Label {
364 text: i18n.tr("Delete")
365 verticalAlignment: Text.AlignVCenter
366 anchors {
367 top: parent.top
368 bottom: parent.bottom
369 }
370 width: units.gu(7)
371 fontSize: "medium"
372 }
373 }
374
375 MouseArea {
376 anchors.fill: parent
377 onClicked: removeItemAnimation.start()
378 }
379 }
380
381
317 states: [382 states: [
318 State {383 State {
319 name: "SwipingRight"384 name: "SwipingRight"
385
320 AnchorChanges {386 AnchorChanges {
321 target: backgroundIndicator387 target: backgroundIndicator
322 anchors.left: parent.left388 anchors.left: parent.left
323 anchors.right: body.left389 anchors.right: body.left
324 }390 }
391
325 PropertyChanges {392 PropertyChanges {
326 target: backgroundIndicator393 target: backgroundIndicator
327 opacity: 1.0394 opacity: 1.0
328 }395 }
396
397 PropertyChanges {
398 target: confirmRemovalDialog
399 x: body.x - confirmRemovalDialog.width - units.gu(2)
400 }
329 },401 },
330 State {402 State {
331 name: "SwipingLeft"403 name: "SwipingLeft"
@@ -334,10 +406,16 @@
334 anchors.left: body.right406 anchors.left: body.right
335 anchors.right: parent.right407 anchors.right: parent.right
336 }408 }
409
337 PropertyChanges {410 PropertyChanges {
338 target: backgroundIndicator411 target: backgroundIndicator
339 opacity: 1.0412 opacity: 1.0
340 }413 }
414
415 PropertyChanges {
416 target: confirmRemovalDialog
417 x: units.gu(2)
418 }
341 }419 }
342 ]420 ]
343 }421 }
@@ -375,12 +453,17 @@
375 }453 }
376 }454 }
377455
456 onClicked: {
457 if (body.x != 0) {
458 priv.resetDrag()
459 }
460 }
461
378 onReleased: {462 onReleased: {
379 priv.endDrag();463 priv.endDrag();
380 }464 }
381465
382 onCanceled: {466 onCanceled: {
383
384 priv.endDrag();467 priv.endDrag();
385 }468 }
386 }469 }
387470
=== added file 'modules/Ubuntu/Components/ListItems/artwork/delete@8.png'
388Binary files modules/Ubuntu/Components/ListItems/artwork/delete@8.png 1970-01-01 00:00:00 +0000 and modules/Ubuntu/Components/ListItems/artwork/delete@8.png 2013-09-30 12:01:05 +0000 differ471Binary files modules/Ubuntu/Components/ListItems/artwork/delete@8.png 1970-01-01 00:00:00 +0000 and modules/Ubuntu/Components/ListItems/artwork/delete@8.png 2013-09-30 12:01:05 +0000 differ

Subscribers

People subscribed via source and target branches

to status/vote changes: