1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-20 19:57:45 +00:00
astra/launcher/ui/Settings/ProfilesPage.qml

66 lines
No EOL
1.7 KiB
QML

// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import QtQuick.Window
import org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.formcard as FormCard
import zone.xiv.astra
FormCard.FormCardPage {
id: page
title: i18nc("@title:window", "Profiles")
FormCard.FormCard {
Layout.fillWidth: true
Layout.topMargin: Kirigami.Units.largeSpacing
Repeater {
model: LauncherCore.profileManager
ColumnLayout {
id: layout
required property var profile
required property int index
spacing: 0
FormCard.FormButtonDelegate {
id: buttonDelegate
text: layout.profile.name
onClicked: page.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "ProfileSettings"), {
profile: layout.profile
})
}
FormCard.FormDelegateSeparator {
visible: layout.index + 1 < LauncherCore.profileManager.numProfiles()
}
}
}
}
FormCard.FormCard {
Layout.fillWidth: true
Layout.topMargin: Kirigami.Units.largeSpacing
FormCard.FormButtonDelegate {
id: addProfileButton
text: i18n("Add Profile")
icon.name: "list-add"
onClicked: {
page.Window.window.close();
LauncherCore.currentProfile = LauncherCore.profileManager.addProfile();
}
}
}
}