mirror of https://github.com/KDE/kasts.git
Also handle opening the settings dialog through pushPage()
This commit is contained in:
parent
188c1d08e4
commit
e6052dbbba
|
@ -49,10 +49,7 @@ Kirigami.NavigationTabBar {
|
||||||
text: i18n("Settings")
|
text: i18n("Settings")
|
||||||
checked: "SettingsPage" === kastsMainWindow.currentPage
|
checked: "SettingsPage" === kastsMainWindow.currentPage
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
applicationWindow().pageStack.clear()
|
pushPage("SettingsPage")
|
||||||
applicationWindow().pageStack.push("qrc:/SettingsPage.qml", {}, {
|
|
||||||
title: i18n("Settings")
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -62,11 +62,18 @@ Kirigami.ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function pushPage(page) {
|
function pushPage(page) {
|
||||||
|
if (page === "SettingsPage") {
|
||||||
|
pageStack.layers.clear()
|
||||||
|
pageStack.pushDialogLayer("qrc:/SettingsPage.qml", {}, {
|
||||||
|
title: i18n("Settings")
|
||||||
|
})
|
||||||
|
} else {
|
||||||
pageStack.clear();
|
pageStack.clear();
|
||||||
pageStack.layers.clear();
|
pageStack.layers.clear();
|
||||||
pageStack.push(getPage(page));
|
pageStack.push(getPage(page));
|
||||||
currentPage = page;
|
currentPage = page;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Settings {
|
Settings {
|
||||||
id: settings
|
id: settings
|
||||||
|
@ -249,10 +256,7 @@ Kirigami.ApplicationWindow {
|
||||||
checked: currentPage == "SettingsPage"
|
checked: currentPage == "SettingsPage"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
checked = false;
|
checked = false;
|
||||||
kastsMainWindow.pageStack.layers.clear()
|
pushPage("SettingsPage")
|
||||||
kastsMainWindow.pageStack.pushDialogLayer("qrc:/SettingsPage.qml", {}, {
|
|
||||||
title: i18n("Settings")
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue