From 6487e1a725904b253cece131d47ee5664803195f Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Thu, 28 Mar 2024 16:42:52 -0400 Subject: [PATCH] Further page improvements Fix the header disappearing when cancelling auto-login, set the main window title automatically. Also add a name to the settings window. --- launcher/ui/Main.qml | 14 ++++++++------ launcher/ui/Pages/MainPage.qml | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/launcher/ui/Main.qml b/launcher/ui/Main.qml index 56ab7d6..cf867fe 100644 --- a/launcher/ui/Main.qml +++ b/launcher/ui/Main.qml @@ -17,7 +17,7 @@ Kirigami.ApplicationWindow { minimumWidth: 800 minimumHeight: 500 - title: "Astra" + title: pageStack.currentItem?.title property bool checkedAutoLogin: false @@ -44,16 +44,17 @@ Kirigami.ApplicationWindow { return } - pageStack.layers.clear() + pageStack.clear() + pageStack.layers.clear(); if (!LauncherCore.currentProfile.isGameInstalled) { // User must set up the profile - pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "SetupPage"), { + pageStack.push(Qt.createComponent("zone.xiv.astra", "SetupPage"), { profile: LauncherCore.currentProfile }) } else if (!LauncherCore.currentProfile.account) { // User must select an account for the profile - pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AccountSetup"), { + pageStack.push(Qt.createComponent("zone.xiv.astra", "AccountSetup"), { profile: LauncherCore.currentProfile }) } else { @@ -61,14 +62,15 @@ Kirigami.ApplicationWindow { pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AutoLoginPage")) checkedAutoLogin = true; } else { - pageStack.replace(Qt.createComponent("zone.xiv.astra", "MainPage")) + pageStack.push(Qt.createComponent("zone.xiv.astra", "MainPage")) } } } function cancelAutoLogin() { + pageStack.clear(); pageStack.layers.clear(); - pageStack.layers.replace(Qt.createComponent("zone.xiv.astra", "MainPage")); + pageStack.push(Qt.createComponent("zone.xiv.astra", "MainPage")); } function pushDialogLayer(url) { diff --git a/launcher/ui/Pages/MainPage.qml b/launcher/ui/Pages/MainPage.qml index e71da44..4fa2f8d 100644 --- a/launcher/ui/Pages/MainPage.qml +++ b/launcher/ui/Pages/MainPage.qml @@ -28,7 +28,7 @@ Kirigami.Page { Kirigami.Action { text: i18nc("@action:button", "Settings") icon.name: "configure" - onTriggered: applicationWindow().pushDialogLayer(Qt.createComponent("zone.xiv.astra", "SettingsPage")) + onTriggered: applicationWindow().pageStack.pushDialogLayer(Qt.createComponent("zone.xiv.astra", "SettingsPage"), {}, { title: i18nc("@title:window", "Settings") }) } ]