Commit 08c0e551 authored by Rinigus Saar's avatar Rinigus Saar

drop all subpages before adding a new

parent 5df16729
...@@ -80,6 +80,7 @@ Kirigami.ApplicationWindow { ...@@ -80,6 +80,7 @@ Kirigami.ApplicationWindow {
Kirigami.Action { Kirigami.Action {
icon.name: "tab-duplicate" icon.name: "tab-duplicate"
onTriggered: { onTriggered: {
popSubPages();
pageStack.push(Qt.resolvedUrl("Tabs.qml")) pageStack.push(Qt.resolvedUrl("Tabs.qml"))
} }
text: i18n("Tabs") text: i18n("Tabs")
...@@ -94,6 +95,7 @@ Kirigami.ApplicationWindow { ...@@ -94,6 +95,7 @@ Kirigami.ApplicationWindow {
Kirigami.Action { Kirigami.Action {
icon.name: "bookmarks" icon.name: "bookmarks"
onTriggered: { onTriggered: {
popSubPages();
pageStack.push(Qt.resolvedUrl("Bookmarks.qml")) pageStack.push(Qt.resolvedUrl("Bookmarks.qml"))
} }
text: i18n("Bookmarks") text: i18n("Bookmarks")
...@@ -101,6 +103,7 @@ Kirigami.ApplicationWindow { ...@@ -101,6 +103,7 @@ Kirigami.ApplicationWindow {
Kirigami.Action { Kirigami.Action {
icon.name: "view-history" icon.name: "view-history"
onTriggered: { onTriggered: {
popSubPages();
pageStack.push(Qt.resolvedUrl("History.qml")) pageStack.push(Qt.resolvedUrl("History.qml"))
} }
text: i18n("History") text: i18n("History")
...@@ -109,6 +112,7 @@ Kirigami.ApplicationWindow { ...@@ -109,6 +112,7 @@ Kirigami.ApplicationWindow {
icon.name: "configure" icon.name: "configure"
text: i18n("Settings") text: i18n("Settings")
onTriggered: { onTriggered: {
popSubPages();
pageStack.push(Qt.resolvedUrl("SettingsPage.qml")) pageStack.push(Qt.resolvedUrl("SettingsPage.qml"))
} }
} }
...@@ -377,8 +381,7 @@ Kirigami.ApplicationWindow { ...@@ -377,8 +381,7 @@ Kirigami.ApplicationWindow {
// drop all sub pages as soon as the browser window is the // drop all sub pages as soon as the browser window is the
// focussed one // focussed one
if (webBrowser.pageStack.currentIndex === 0) if (webBrowser.pageStack.currentIndex === 0)
while (webBrowser.pageStack.depth > 1) popSubPages();
webBrowser.pageStack.pop();
} }
} }
...@@ -395,4 +398,9 @@ Kirigami.ApplicationWindow { ...@@ -395,4 +398,9 @@ Kirigami.ApplicationWindow {
} }
Component.onCompleted: rootPage.initialized = true Component.onCompleted: rootPage.initialized = true
function popSubPages() {
while (webBrowser.pageStack.depth > 1)
webBrowser.pageStack.pop();
}
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment