on xenial help sign in
Use Loader for the swipeToAct widget to save some resources, if it is not used.
commit69b793ff0f4a8c05fd28f1568cb2d5dd017cad4f authorMirco Müller <mirco.mueller@canonical.com> dateWed 29 Oct 2014, 15:45 (12 years ago) parent852e978
1 file changed+19−13
qml/Notifications/Notification.qml+19−13
qml/Notifications/Notification.qml+19−13
@@ -404,21 +404,27 @@ Item {
404404 spacing: units.gu(2)
405405 layoutDirection: Qt.RightToLeft
406406
407− SwipeToAct {
408− id: notifySwipeButton
409− objectName: "notify_swipe_button"
410− visible: notification.hints["x-canonical-snap-decisions-swipe"] === "true"
411− leftIconName: "call-end"
412− rightIconName: "call-start"
413− width: buttonRow.width
414−
415− onLeftTriggered: {
416− notification.notification.invokeAction(notification.actions.data(0, ActionModel.RoleActionId))
417− }
407+ Loader {
408+ id: notifySwipeButtonLoader
409+
410+ Component {
411+ id: notifySwipeButton
412+
413+ SwipeToAct {
414+ objectName: "notify_swipe_button"
415+ width: buttonRow.width
416+ leftIconName: "call-end"
417+ rightIconName: "call-start"
418+ onLeftTriggered: {
419+ notification.notification.invokeAction(notification.actions.data(0, ActionModel.RoleActionId))
420+ }
418421
419− onRightTriggered: {
420− notification.notification.invokeAction(notification.actions.data(1, ActionModel.RoleActionId))
422+ onRightTriggered: {
423+ notification.notification.invokeAction(notification.actions.data(1, ActionModel.RoleActionId))
424+ }
425+ }
421426 }
427+ sourceComponent: notification.hints["x-canonical-snap-decisions-swipe"] === "true" ? notifySwipeButton : undefined
422428 }
423429
424430 Repeater {