From e6052dbbba6c378f00e42ceecdbd5797854747b4 Mon Sep 17 00:00:00 2001 From: Bart De Vries Date: Wed, 26 Apr 2023 16:23:35 +0200 Subject: [PATCH] Also handle opening the settings dialog through pushPage() --- src/qml/Mobile/BottomToolbar.qml | 5 +---- src/qml/main.qml | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/qml/Mobile/BottomToolbar.qml b/src/qml/Mobile/BottomToolbar.qml index 787ff1ad..8790d059 100644 --- a/src/qml/Mobile/BottomToolbar.qml +++ b/src/qml/Mobile/BottomToolbar.qml @@ -49,10 +49,7 @@ Kirigami.NavigationTabBar { text: i18n("Settings") checked: "SettingsPage" === kastsMainWindow.currentPage onTriggered: { - applicationWindow().pageStack.clear() - applicationWindow().pageStack.push("qrc:/SettingsPage.qml", {}, { - title: i18n("Settings") - }) + pushPage("SettingsPage") } } ] diff --git a/src/qml/main.qml b/src/qml/main.qml index 5682ce9c..1bd56611 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -62,10 +62,17 @@ Kirigami.ApplicationWindow { } } function pushPage(page) { - pageStack.clear(); - pageStack.layers.clear(); - pageStack.push(getPage(page)); - currentPage = page; + if (page === "SettingsPage") { + pageStack.layers.clear() + pageStack.pushDialogLayer("qrc:/SettingsPage.qml", {}, { + title: i18n("Settings") + }) + } else { + pageStack.clear(); + pageStack.layers.clear(); + pageStack.push(getPage(page)); + currentPage = page; + } } Settings { @@ -249,10 +256,7 @@ Kirigami.ApplicationWindow { checked: currentPage == "SettingsPage" onClicked: { checked = false; - kastsMainWindow.pageStack.layers.clear() - kastsMainWindow.pageStack.pushDialogLayer("qrc:/SettingsPage.qml", {}, { - title: i18n("Settings") - }) + pushPage("SettingsPage") } } }