1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-05-01 16:37:44 +00:00

Port from CategorizedSettings to ConfigurationView component

This also fixes a bug where the General settings page never loads.
This commit is contained in:
Joshua Goins 2025-04-29 00:14:03 -04:00
parent 5f19a69e72
commit 8d91fe3f78
2 changed files with 24 additions and 41 deletions

View file

@ -28,7 +28,7 @@ Kirigami.Page {
Kirigami.Action { Kirigami.Action {
text: i18nc("@action:button", "Settings") text: i18nc("@action:button", "Settings")
icon.name: "configure" icon.name: "configure"
onTriggered: applicationWindow().pageStack.pushDialogLayer(Qt.createComponent("zone.xiv.astra", "SettingsPage"), {}, { title: i18nc("@title:window", "Settings") }) onTriggered: Qt.createComponent("zone.xiv.astra", "SettingsPage").createObject().open()
} }
] ]

View file

@ -9,71 +9,54 @@ import org.kde.kirigamiaddons.components as KirigamiComponents
import zone.xiv.astra import zone.xiv.astra
KirigamiSettings.CategorizedSettings { KirigamiSettings.ConfigurationView {
id: settingsPage id: settingsPage
KirigamiComponents.FloatingButton { modules: [
anchors { KirigamiSettings.ConfigurationModule {
right: parent.right moduleId: "general"
bottom: parent.bottom
}
z: 100
margins: Kirigami.Units.largeSpacing
visible: LauncherCore.isSteamDeck
action: Kirigami.Action {
text: i18nc("@action:button", "Close Settings")
icon.name: "dialog-close-symbolic"
onTriggered: pageStack.layers.pop()
}
}
actions: [
KirigamiSettings.SettingAction {
actionName: "general"
text: i18n("General") text: i18n("General")
icon.name: "zone.xiv.astra" icon.name: "zone.xiv.astra"
page: Qt.resolvedUrl("/qt/qml/zone/xiv/astra/ui/Settings/GeneralSettings.qml") page: () => Qt.createComponent("zone.xiv.astra", "GeneralSettings")
}, },
KirigamiSettings.SettingAction { KirigamiSettings.ConfigurationModule {
actionName: "profiles" moduleId: "profiles"
text: i18n("Profiles") text: i18n("Profiles")
icon.name: "applications-games-symbolic" icon.name: "applications-games-symbolic"
page: Qt.resolvedUrl("/qt/qml/zone/xiv/astra/ui/Settings/ProfilesPage.qml") page: () => Qt.createComponent("zone.xiv.astra", "ProfilesPage")
}, },
KirigamiSettings.SettingAction { KirigamiSettings.ConfigurationModule {
actionName: "accounts" moduleId: "accounts"
text: i18n("Accounts") text: i18n("Accounts")
icon.name: "preferences-system-users-symbolic" icon.name: "preferences-system-users-symbolic"
page: Qt.resolvedUrl("/qt/qml/zone/xiv/astra/ui/Settings/AccountsPage.qml") page: () => Qt.createComponent("zone.xiv.astra", "AccountsPage")
}, },
KirigamiSettings.SettingAction { KirigamiSettings.ConfigurationModule {
actionName: "sync" moduleId: "sync"
text: i18n("Synchronization") text: i18n("Synchronization")
icon.name: "state-sync-symbolic" icon.name: "state-sync-symbolic"
page: Qt.resolvedUrl("/qt/qml/zone/xiv/astra/ui/Settings/SyncSettings.qml") page: () => Qt.createComponent("zone.xiv.astra", "SyncSettings")
visible: LauncherCore.supportsSync() visible: LauncherCore.supportsSync()
}, },
KirigamiSettings.SettingAction { KirigamiSettings.ConfigurationModule {
actionName: "compattool" moduleId: "compattool"
text: i18n("Compatibility Tool") text: i18n("Compatibility Tool")
icon.name: "system-run-symbolic" icon.name: "system-run-symbolic"
page: Qt.resolvedUrl("/qt/qml/zone/xiv/astra/ui/Settings/CompatibilityToolSetup.qml") page: () => Qt.createComponent("zone.xiv.astra", "CompatibilityToolSetup")
visible: !LauncherCore.isWindows visible: !LauncherCore.isWindows
}, },
KirigamiSettings.SettingAction { KirigamiSettings.ConfigurationModule {
actionName: "devtool" moduleId: "devtool"
text: i18n("Developer Settings") text: i18n("Developer Settings")
icon.name: "preferences-others-symbolic" icon.name: "preferences-others-symbolic"
page: Qt.resolvedUrl("/qt/qml/zone/xiv/astra/ui/Settings/DeveloperSettings.qml") page: () => Qt.createComponent("zone.xiv.astra", "DeveloperSettings")
visible: LauncherCore.config.showDevTools visible: LauncherCore.config.showDevTools
}, },
KirigamiSettings.SettingAction { KirigamiSettings.ConfigurationModule {
actionName: "about" moduleId: "about"
text: i18n("About Astra") text: i18n("About Astra")
icon.name: "help-about-symbolic" icon.name: "help-about-symbolic"
page: Qt.resolvedUrl("/qt/qml/zone/xiv/astra/ui/Settings/AboutPage.qml") page: () => Qt.createComponent("zone.xiv.astra", "AboutPage")
} }
] ]
} }