diff --git a/look-and-feel/contents/lockscreen/LockScreen.qml b/look-and-feel/contents/lockscreen/LockScreen.qml index 058866d0..79b10702 100644 --- a/look-and-feel/contents/lockscreen/LockScreen.qml +++ b/look-and-feel/contents/lockscreen/LockScreen.qml @@ -41,7 +41,19 @@ PlasmaCore.ColorScope { function isPinDrawerOpen() { return passwordFlickable.contentY === passwordFlickable.columnHeight; } - + + function askPassword() { + showPasswordAnim.restart(); + } + NumberAnimation { + id: showPasswordAnim + target: passwordFlickable + property: "contentY" + from: 0 + to: passwordFlickable.contentHeight - passwordFlickable.height + duration: units.longDuration + easing.type: Easing.InOutQuad + } // blur background once keypad is open FastBlur { id: blur diff --git a/look-and-feel/contents/lockscreen/NotificationsList.qml b/look-and-feel/contents/lockscreen/NotificationsList.qml index ac82b172..1eb6149e 100644 --- a/look-and-feel/contents/lockscreen/NotificationsList.qml +++ b/look-and-feel/contents/lockscreen/NotificationsList.qml @@ -25,10 +25,13 @@ import org.kde.notificationmanager 1.1 as Notifications import "../components" Item { + id: notificationsRoot property alias notificationListHeight: notificationListView.contentHeight property int count: notificationListView.count clip: true + property var pendingAction: {"notificationId": 0, "actionName": ""} + Rectangle { z: 1 anchors { @@ -86,7 +89,25 @@ Item { color: Qt.rgba(1, 1, 1, 0.5) } } - + + Connections { + target: authenticator + function onSucceeded() { + if (notificationsRoot.pendingAction.notificationId !== 0) { + if (notificationsRoot.pendingAction.actionName.length == 0) { + notifModel.invokeDefaultAction(pendingAction.notificationId); + } else { + notifModel.invokeAction(pendingAction.notificationId, pendingAction.actionName); + } + + notificationsRoot.pendingAction = {"notificationId": 0, "actionName":""}; + } + } + function onFailed() { + notificationsRoot.pendingAction = {"notificationId": 0, "actionName":""}; + } + } + ListView { id: notificationListView model: notifModel diff --git a/look-and-feel/contents/lockscreen/SimpleNotification.qml b/look-and-feel/contents/lockscreen/SimpleNotification.qml index 764bd8ac..0cf5c918 100644 --- a/look-and-feel/contents/lockscreen/SimpleNotification.qml +++ b/look-and-feel/contents/lockscreen/SimpleNotification.qml @@ -162,7 +162,13 @@ Item { text: modelData.label || "" onClicked: { - notifModel.invokeAction(notificationItem.notification.notificationId, modelData.actionName); + if (notificationItem.notification.category === "x-kde.incoming-call") { + notifModel.invokeAction(notificationItem.notification.notificationId, modelData.actionName); + } else { + notificationsRoot.pendingAction = {"notificationId": notificationItem.notification.notificationId, + "actionName":modelData.actionName}; + root.askPassword(); + } } } } @@ -187,6 +193,15 @@ Item { } else { slideAnim.restart(); } + if (notificationItem.notification.hasDefaultAction && Math.abs(rect.x) < units.gridUnit) { + if (notificationItem.notification.category === "x-kde.incoming-call") { + notifModel.invokeDefaultAction(notificationItem.notification.notificationId); + } else { + notificationsRoot.pendingAction = {"notificationId": notificationItem.notification.notificationId, + "actionName": ""}; + root.askPassword(); + } + } } NumberAnimation {