on xenial help sign in
Make SwipeToAct-widget slightly delay emitting the signal of a selected choice to allow showing the outlined button as an additional verification clue to the user... as Design requested.
efac0c0Mirco Müller
qml/Notifications/SwipeToAct.qml+18−12
@@ -153,22 +153,28 @@ Item {
153 id: slider
153 id: slider
154
154
155 Behavior on x {
155 Behavior on x {
156− id: xBehavior
157−
158 UbuntuNumberAnimation {
156 UbuntuNumberAnimation {
159 duration: UbuntuAnimation.FastDuration
157 duration: UbuntuAnimation.FastDuration
160 easing.type: Easing.OutBounce
158 easing.type: Easing.OutBounce
161 }
159 }
162 }
160 }
163
161
164− onXChanged: {
162+ Behavior on opacity {
163+ UbuntuNumberAnimation {
164+ duration: UbuntuAnimation.FastDuration
165+ }
166+ }
167+
168+ onOpacityChanged: {
165− if (x === 0.0) {
169+ if (opacity === 0) {
166− leftTriggered()
170+ if (rightShape.state === "selected") {
167− }
168− if (x === row.width - slider.width) {
169− rightTriggered()
171+ rightTriggered()
172+ }
173+ if (leftShape.state === "selected") {
174+ leftTriggered()
175+ }
170− }
176+ }
171− }
177+ }
172
178
173 z: 1
179 z: 1
174 color: "white"
180 color: "white"
@@ -268,13 +274,13 @@ Item {
268 if (slider.x === drag.minimumX) {
274 if (slider.x === drag.minimumX) {
269 slider.x = drag.minimumX
275 slider.x = drag.minimumX
270 slider.opacity = 0
276 slider.opacity = 0
271− visible = false
277+ enabled = false
272 leftShape.state = "selected"
278 leftShape.state = "selected"
273 }
279 }
274 if (slider.x === drag.maximumX) {
280 if (slider.x === drag.maximumX) {
275 slider.x = drag.maximumX
281 slider.x = drag.maximumX
276 slider.opacity = 0
282 slider.opacity = 0
277− visible = false
283+ enabled = false
278 rightShape.state = "selected"
284 rightShape.state = "selected"
279 }
285 }
280 }
286 }