1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-05-01 08:27:45 +00:00
astra/launcher/ui/Pages/MainPage.qml
Joshua Goins d69ebf91c7 Add tools menu back to the main toolbar
This was lost in the QML rewrite, even though it's still useful. In this
menu you can launch the official launcher, system information and the
config backup tool easily.
2025-04-29 15:14:45 -04:00

88 lines
2.6 KiB
QML

// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick
import QtQuick.Controls as QQC2
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import zone.xiv.astra
Kirigami.Page {
id: page
title: i18n("Home")
topPadding: 0
leftPadding: 0
rightPadding: 0
bottomPadding: 0
actions: [
Kirigami.Action {
text: i18nc("@action:button", "Server Status")
icon.name: "cloudstatus"
onTriggered: applicationWindow().openUrl('https://na.finalfantasyxiv.com/lodestone/worldstatus/')
},
Kirigami.Action {
text: i18nc("@action:menu", "Tools")
icon.name: "tools"
visible: !LauncherCore.currentProfile.config.isBenchmark
Kirigami.Action {
text: i18nc("@action:inmenu", "Official Launcher")
icon.name: "application-x-executable"
onTriggered: LauncherCore.openOfficialLauncher(LauncherCore.currentProfile)
}
Kirigami.Action {
text: i18nc("@action:inmenu", "System Info")
icon.name: "application-x-executable"
onTriggered: LauncherCore.openSystemInfo(LauncherCore.currentProfile)
}
Kirigami.Action {
text: i18nc("@action:inmenu", "Config Backup")
icon.name: "application-x-executable"
onTriggered: LauncherCore.openConfigBackup(LauncherCore.currentProfile)
}
},
Kirigami.Action {
text: i18nc("@action:button", "Settings")
icon.name: "configure"
onTriggered: Qt.createComponent("zone.xiv.astra", "SettingsPage").createObject(page, { window: applicationWindow() }).open()
}
]
RowLayout {
anchors.fill: parent
spacing: 0
LoginPage {
id: loginPage
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
Layout.minimumWidth: Kirigami.Units.gridUnit * 26
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.fillHeight: true
}
Kirigami.Separator {
Layout.fillHeight: true
}
Loader {
Layout.fillWidth: true
Layout.fillHeight: true
sourceComponent: QQC2.ScrollView {
id: scrollView
NewsPage {
width: scrollView.availableWidth
height: Math.max(scrollView.availableHeight, page.height, implicitHeight)
}
}
}
}
}