From 212f60077ff33c0e41fbc57274fcb429f673d663 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 27 Apr 2015 11:51:37 +0200 Subject: [PATCH] execute action when swiping left --- .../notifications/contents/ui/NotificationStripe.qml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/applets/notifications/contents/ui/NotificationStripe.qml b/applets/notifications/contents/ui/NotificationStripe.qml index 2023446d..f555b622 100644 --- a/applets/notifications/contents/ui/NotificationStripe.qml +++ b/applets/notifications/contents/ui/NotificationStripe.qml @@ -48,11 +48,16 @@ MouseArea { onReleased: { if (drag.active) { if (x > width / 4 || x < width / -4) { + //if there is an action, execute the first when swiping left + if (x < 0 && actions) { + var action = actions.get(0) + root.executeAction(source, action.id) + } notificationsModel.remove(index); } else { x = 0; } - } else if (body) { + } else if (body || actions) { expanded = !expanded; } } @@ -134,7 +139,10 @@ MouseArea { model: notificationItem.actions delegate: PlasmaComponents.Button { text: model.text - onClicked: root.executeAction(notificationItem.source, model.id) + onClicked: { + root.executeAction(notificationItem.source, model.id) + notificationsModel.remove(index); + } } } }