diff --git a/launcher/resources.qrc b/launcher/resources.qrc index 0a0ee2b..d4cd555 100644 --- a/launcher/resources.qrc +++ b/launcher/resources.qrc @@ -3,6 +3,7 @@ ui/Components/FormFileDelegate.qml ui/Components/FormFolderDelegate.qml ui/Pages/LoginPage.qml + ui/Pages/MainPage.qml ui/Pages/NewsPage.qml ui/Pages/StatusPage.qml ui/Settings/AccountSettings.qml diff --git a/launcher/ui/Pages/LoginPage.qml b/launcher/ui/Pages/LoginPage.qml index b6e5a35..82fa8bb 100644 --- a/launcher/ui/Pages/LoginPage.qml +++ b/launcher/ui/Pages/LoginPage.qml @@ -9,7 +9,7 @@ import QtQuick.Layouts 1.15 import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm import com.redstrate.astra 1.0 -Kirigami.OverlayDrawer { +Controls.Control { id: page property var profile: LauncherCore.profileManager.getProfile(0) @@ -49,7 +49,7 @@ Kirigami.OverlayDrawer { onProfileChanged: updateFields() - ColumnLayout { + contentItem: ColumnLayout { width: parent.width MobileForm.FormCard { Layout.topMargin: Kirigami.Units.largeSpacing diff --git a/launcher/ui/Pages/MainPage.qml b/launcher/ui/Pages/MainPage.qml new file mode 100644 index 0000000..364adba --- /dev/null +++ b/launcher/ui/Pages/MainPage.qml @@ -0,0 +1,37 @@ +// SPDX-FileCopyrightText: 2023 Joshua Goins +// SPDX-License-Identifier: GPL-3.0-or-later + +import QtQuick 2.15 +import QtQuick.Window 2.15 +import org.kde.kirigami 2.20 as Kirigami +import QtQuick.Controls 2.15 as Controls +import QtQuick.Layouts 1.15 +import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm +import com.redstrate.astra 1.0 + +Kirigami.Page { + id: page + + globalToolBarStyle: Kirigami.ApplicationHeaderStyle.None + + RowLayout { + width: parent.width + height: parent.height + + Controls.ScrollView { + id: scrollView + + Layout.fillWidth: true + Layout.fillHeight: true + + NewsPage { + width: scrollView.width + height: scrollView.height + } + } + LoginPage { + Layout.alignment: Qt.AlignTop + Layout.fillWidth: true + } + } +} \ No newline at end of file diff --git a/launcher/ui/Pages/NewsPage.qml b/launcher/ui/Pages/NewsPage.qml index dca66ca..4e13c34 100644 --- a/launcher/ui/Pages/NewsPage.qml +++ b/launcher/ui/Pages/NewsPage.qml @@ -9,11 +9,9 @@ import QtQuick.Layouts 1.15 import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm import com.redstrate.astra 1.0 -Kirigami.ScrollablePage { +Controls.Control { id: page - globalToolBarStyle: Kirigami.ApplicationHeaderStyle.None - Component.onCompleted: LauncherCore.refreshNews() property int currentBannerIndex: 0 @@ -42,7 +40,7 @@ Kirigami.ScrollablePage { } } - ColumnLayout { + contentItem: ColumnLayout { width: parent.width MobileForm.FormCard { Layout.topMargin: Kirigami.Units.largeSpacing diff --git a/launcher/ui/main.qml b/launcher/ui/main.qml index b1633a5..a40ff59 100644 --- a/launcher/ui/main.qml +++ b/launcher/ui/main.qml @@ -20,8 +20,7 @@ Kirigami.ApplicationWindow { property var currentSetupProfile: LauncherCore.profileManager.getProfile(0) - pageStack.initialPage: Kirigami.Page - { + pageStack.initialPage: Kirigami.Page { Kirigami.LoadingPlaceholder { anchors.centerIn: parent } @@ -45,7 +44,7 @@ Kirigami.ApplicationWindow { profile: currentSetupProfile }) } else { - pageStack.layers.replace('qrc:/ui/Pages/NewsPage.qml') + pageStack.layers.replace('qrc:/ui/Pages/MainPage.qml') } } @@ -57,18 +56,5 @@ Kirigami.ApplicationWindow { } } - contextDrawer: LoginPage { - drawerOpen: true - modal: false - - edge: Qt.RightEdge - - topPadding: 0 - leftPadding: 0 - rightPadding: 0 - - width: 400 - } - Component.onCompleted: checkSetup() }