on xenial help sign in
Allow ENTER/RETURN in a TextField to accept a snap-decision notification. Fixes: 1305885
d68b222Mirco Müller
qml/Notifications/Notification.qml+3
@@ -311,6 +311,9 @@ Item {
311 onLoaded: {
311 onLoaded: {
312 notification.fullscreen = Qt.binding(function() { return fullscreen; });
312 notification.fullscreen = Qt.binding(function() { return fullscreen; });
313 }
313 }
314+ onAccepted: {
315+ notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
316+ }
314 }
317 }
315 }
318 }
316 }
319 }
qml/Notifications/NotificationMenuItemFactory.qml+5
@@ -30,6 +30,8 @@ Loader {
30 property int maxHeight
30 property int maxHeight
31 readonly property bool fullscreen: menuData.type === "com.canonical.snapdecision.pinlock"
31 readonly property bool fullscreen: menuData.type === "com.canonical.snapdecision.pinlock"
32
32
33+ signal accepted()
34+
33 property var _map: {
35 property var _map: {
34 "com.canonical.snapdecision.textfield": textfield,
36 "com.canonical.snapdecision.textfield": textfield,
35 "com.canonical.snapdecision.pinlock" : pinLock,
37 "com.canonical.snapdecision.pinlock" : pinLock,
@@ -82,6 +84,9 @@ Loader {
82 onTextChanged: {
84 onTextChanged: {
83 menuModel.changeState(menuIndex, text);
85 menuModel.changeState(menuIndex, text);
84 }
86 }
87+ onAccepted: {
88+ menuFactory.accepted()
89+ }
85 }
90 }
86
91
87 Row {
92 Row {