1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-22 12:47:44 +00:00
astra/launcher/ui/Settings/ProfilesPage.qml

66 lines
1.7 KiB
QML
Raw Normal View History

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