diff --git a/touch/Dialog.qml b/touch/Dialog.qml index 65f929a..a73f244 100644 --- a/touch/Dialog.qml +++ b/touch/Dialog.qml @@ -28,7 +28,11 @@ Rectangle { color: Constants.colors.dialogBackground - Component.onCompleted: pgst.dialogsVisible = pgst.dialogsVisible + 1; + Component.onCompleted: { + pgst.dialogsVisible = pgst.dialogsVisible + 1; + pgst.topOfStackChanged(); + } + Component.onDestruction: pgst.dialogsVisible = pgst.dialogsVisible - 1; default property alias children: contents.children diff --git a/touch/DialogStacking.qml b/touch/DialogStacking.qml index 0752071..13f77af 100644 --- a/touch/DialogStacking.qml +++ b/touch/DialogStacking.qml @@ -48,6 +48,7 @@ Item { function startFadeOut() { fadeOut.start(); + pgst.topOfStackChanged(-1); page.destroy(500); } diff --git a/touch/Main.qml b/touch/Main.qml index bd48616..9bd3624 100644 --- a/touch/Main.qml +++ b/touch/Main.qml @@ -53,7 +53,11 @@ Item { break; case Qt.Key_Escape: case Qt.Key_Backspace: - backButton.clicked(); + case Qt.Key_Back: + if (backButton.enabled) { + backButton.clicked(); + event.accepted = true; + } break; default: break; @@ -102,7 +106,7 @@ Item { var page = children[children.length+offset-1]; - pgst.hasBackButton = Qt.binding(function () { return (!page.isDialog && page.canClose); }); + pgst.hasBackButton = Qt.binding(function () { return page.isDialog || page.canClose; }); pgst.hasMenuButton = Qt.binding(function () { return page.hasMenuButton; }); pgst.menuButtonLabel = Qt.binding(function () { return pgst.hasMenuButton ? page.menuButtonLabel : 'Menu'; }); pgst.menuButtonIcon = Qt.binding(function () { return pgst.hasMenuButton ? page.menuButtonIcon : Icons.vellipsis; }); @@ -191,6 +195,9 @@ Item { text: 'Back' icon: Icons.arrow_left + // Don't show back button on Android (Android has its own) + visible: (typeof(gpodderAndroid) === 'undefined') + enabled: pgst.hasBackButton onClicked: { if (enabled) { diff --git a/touch/SlidePage.qml b/touch/SlidePage.qml index ae945ef..8c83cda 100644 --- a/touch/SlidePage.qml +++ b/touch/SlidePage.qml @@ -39,7 +39,9 @@ Rectangle { signal menuButtonClicked() function closePage() { - stacking.startFadeOut(); + if (canClose) { + stacking.startFadeOut(); + } } onXChanged: pgst.update(page, x)