From d19950f0dff2abf5b07a75f98057d975a299810a Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 4 Jul 2017 15:35:45 +0200 Subject: [PATCH] Add support for back key on desktop keyboard --- retroshare-qml-app/src/main-app.qml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index 56873dec3..60d0a62b7 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -193,6 +193,25 @@ ApplicationWindow anchors.fill: parent focus: true onCurrentItemChanged: + { + if (currentItem) + { + currentItem.forceActiveFocus() + setStatus (currentItem) + } + } + + Keys.onReleased: + { + if ((event.key === Qt.Key_Back || Qt.Key_Backspace) && stackView.depth > 1) + { + stackView.pop(); + event.accepted = true; + setStatus (stackView.currentItem) + } + } + + function setStatus (currentItem) { if (currentItem) {