on xenial help sign in
fix positive/negative answer order on the new swipe notification Fixes: 1358343
022cf0eMichael Zanetti
qml/Notifications/Notification.qml+2−2
@@ -477,11 +477,11 @@ Item {
477 width: buttonRow.width
477 width: buttonRow.width
478 leftIconName: "call-end"
478 leftIconName: "call-end"
479 rightIconName: "call-start"
479 rightIconName: "call-start"
480− onLeftTriggered: {
480+ onRightTriggered: {
481 notification.notification.invokeAction(notification.actions.data(0, ActionModel.RoleActionId))
481 notification.notification.invokeAction(notification.actions.data(0, ActionModel.RoleActionId))
482 }
482 }
483
483
484− onRightTriggered: {
484+ onLeftTriggered: {
485 notification.notification.invokeAction(notification.actions.data(1, ActionModel.RoleActionId))
485 notification.notification.invokeAction(notification.actions.data(1, ActionModel.RoleActionId))
486 }
486 }
487 }
487 }
tests/qmltests/Notifications/tst_SwipeToAct.qml+6−6
@@ -259,14 +259,14 @@ Item {
259 var x = swipeMouseArea.width / 2
259 var x = swipeMouseArea.width / 2
260 var y = swipeMouseArea.height / 2
260 var y = swipeMouseArea.height / 2
261
261
262− if(data.checkSwipeToActReject) {
263− tryCompareFunction(function() { mouseDrag(slider, x, y, -(swipeMouseArea.width / 2), 0); return actionSpy.signalArguments.length > 0; }, true);
264− compare(actionSpy.signalArguments[0][0], data.actions.data(0, ActionModel.RoleActionId), "got wrong id for negative action")
265− actionSpy.clear()
266− }
267 if(data.checkSwipeToActAccept) {
262 if(data.checkSwipeToActAccept) {
268 tryCompareFunction(function() { mouseDrag(slider, x, y, (swipeMouseArea.width / 2) - slider.width, 0); return actionSpy.signalArguments.length > 0; }, true);
263 tryCompareFunction(function() { mouseDrag(slider, x, y, (swipeMouseArea.width / 2) - slider.width, 0); return actionSpy.signalArguments.length > 0; }, true);
269− compare(actionSpy.signalArguments[0][0], data.actions.data(1, ActionModel.RoleActionId), "got wrong id for positive action")
264+ compare(actionSpy.signalArguments[0][0], data.actions.data(0, ActionModel.RoleActionId), "got wrong id for positive action")
265+ actionSpy.clear()
266+ }
267+ if(data.checkSwipeToActReject) {
268+ tryCompareFunction(function() { mouseDrag(slider, x, y, -(swipeMouseArea.width / 2), 0); return actionSpy.signalArguments.length > 0; }, true);
269+ compare(actionSpy.signalArguments[0][0], data.actions.data(1, ActionModel.RoleActionId), "got wrong id for negative action")
270 actionSpy.clear()
270 actionSpy.clear()
271 }
271 }
272 }
272 }