on xenial help sign in
Allow ENTER/RETURN in a TextField to accept a snap-decision notification. Fixes: 1305885

Approved by: Michael Zanetti

commitd68b22296733fdf688ae5d7d9971c8a226253cd6 authorMirco Müller <mirco.mueller@ubuntu.com> dateThu 14 Aug 2014, 01:27 (12 years ago) parent75875f6017d1e8
2 files changed+8
qml/Notifications/Notification.qml+3 qml/Notifications/NotificationMenuItemFactory.qml+5
qml/Notifications/Notification.qml+3
@@ -311,6 +311,9 @@ Item {
311311 onLoaded: {
312312 notification.fullscreen = Qt.binding(function() { return fullscreen; });
313313 }
314+ onAccepted: {
315+ notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
316+ }
314317 }
315318 }
316319 }
qml/Notifications/NotificationMenuItemFactory.qml+5
@@ -30,6 +30,8 @@ Loader {
3030 property int maxHeight
3131 readonly property bool fullscreen: menuData.type === "com.canonical.snapdecision.pinlock"
3232
33+ signal accepted()
34+
3335 property var _map: {
3436 "com.canonical.snapdecision.textfield": textfield,
3537 "com.canonical.snapdecision.pinlock" : pinLock,
@@ -82,6 +84,9 @@ Loader {
8284 onTextChanged: {
8385 menuModel.changeState(menuIndex, text);
8486 }
87+ onAccepted: {
88+ menuFactory.accepted()
89+ }
8590 }
8691
8792 Row {