ApplicationWindow catches Qt.Key_Back. By using it to close the global and context drawers ahead of stackView.pop(), we get expected behaviour in Subsurface-mobile, similar to other apps.
Signed-off-by: Rick Walsh <rickmwa...@gmail.com> --- Sebastian, You said you'd rather any changes to qt-mobile/qml/mobilecomponents/* are made upstream, so I'm sending this patch to you as well as the Subsurface list. I couldn't find a tidy way to make the drawers close with the back button without touching qt-mobile/qml/mobilecomponents/. Of course, you are much more familiar with the code than I am, and may know a better way to achieve the same goal. Rick qt-mobile/qml/mobilecomponents/ApplicationWindow.qml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/qt-mobile/qml/mobilecomponents/ApplicationWindow.qml b/qt-mobile/qml/mobilecomponents/ApplicationWindow.qml index 0eaa81e..911f885 100644 --- a/qt-mobile/qml/mobilecomponents/ApplicationWindow.qml +++ b/qt-mobile/qml/mobilecomponents/ApplicationWindow.qml @@ -65,9 +65,17 @@ inputMethod.keyboardRectangle.y) : 0 } focus: true Keys.onReleased: { - if (event.key == Qt.Key_Back && stackView.depth > 1) { - stackView.pop(); - event.accepted = true; + if (event.key == Qt.Key_Back) { + if (root.contextDrawer && root.contextDrawer.opened) { + root.contextDrawer.close(); + event.accepted = true; + } else if (root.globalDrawer && root.globalDrawer.opened) { + root.globalDrawer.close(); + event.accepted = true; + } else if (stackView.depth > 1) { + stackView.pop(); + event.accepted = true; + } } } } -- 2.5.0 _______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel