mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-20 11:47:46 +00:00
Stick the news and login components on the same page
This commit is contained in:
parent
42df874078
commit
fa8c342a1c
5 changed files with 44 additions and 22 deletions
|
@ -3,6 +3,7 @@
|
||||||
<file>ui/Components/FormFileDelegate.qml</file>
|
<file>ui/Components/FormFileDelegate.qml</file>
|
||||||
<file>ui/Components/FormFolderDelegate.qml</file>
|
<file>ui/Components/FormFolderDelegate.qml</file>
|
||||||
<file>ui/Pages/LoginPage.qml</file>
|
<file>ui/Pages/LoginPage.qml</file>
|
||||||
|
<file>ui/Pages/MainPage.qml</file>
|
||||||
<file>ui/Pages/NewsPage.qml</file>
|
<file>ui/Pages/NewsPage.qml</file>
|
||||||
<file>ui/Pages/StatusPage.qml</file>
|
<file>ui/Pages/StatusPage.qml</file>
|
||||||
<file>ui/Settings/AccountSettings.qml</file>
|
<file>ui/Settings/AccountSettings.qml</file>
|
||||||
|
|
|
@ -9,7 +9,7 @@ import QtQuick.Layouts 1.15
|
||||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
||||||
import com.redstrate.astra 1.0
|
import com.redstrate.astra 1.0
|
||||||
|
|
||||||
Kirigami.OverlayDrawer {
|
Controls.Control {
|
||||||
id: page
|
id: page
|
||||||
|
|
||||||
property var profile: LauncherCore.profileManager.getProfile(0)
|
property var profile: LauncherCore.profileManager.getProfile(0)
|
||||||
|
@ -49,7 +49,7 @@ Kirigami.OverlayDrawer {
|
||||||
|
|
||||||
onProfileChanged: updateFields()
|
onProfileChanged: updateFields()
|
||||||
|
|
||||||
ColumnLayout {
|
contentItem: ColumnLayout {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
MobileForm.FormCard {
|
MobileForm.FormCard {
|
||||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||||
|
|
37
launcher/ui/Pages/MainPage.qml
Normal file
37
launcher/ui/Pages/MainPage.qml
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
||||||
|
// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,11 +9,9 @@ import QtQuick.Layouts 1.15
|
||||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
||||||
import com.redstrate.astra 1.0
|
import com.redstrate.astra 1.0
|
||||||
|
|
||||||
Kirigami.ScrollablePage {
|
Controls.Control {
|
||||||
id: page
|
id: page
|
||||||
|
|
||||||
globalToolBarStyle: Kirigami.ApplicationHeaderStyle.None
|
|
||||||
|
|
||||||
Component.onCompleted: LauncherCore.refreshNews()
|
Component.onCompleted: LauncherCore.refreshNews()
|
||||||
|
|
||||||
property int currentBannerIndex: 0
|
property int currentBannerIndex: 0
|
||||||
|
@ -42,7 +40,7 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
contentItem: ColumnLayout {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
MobileForm.FormCard {
|
MobileForm.FormCard {
|
||||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||||
|
|
|
@ -20,8 +20,7 @@ Kirigami.ApplicationWindow {
|
||||||
|
|
||||||
property var currentSetupProfile: LauncherCore.profileManager.getProfile(0)
|
property var currentSetupProfile: LauncherCore.profileManager.getProfile(0)
|
||||||
|
|
||||||
pageStack.initialPage: Kirigami.Page
|
pageStack.initialPage: Kirigami.Page {
|
||||||
{
|
|
||||||
Kirigami.LoadingPlaceholder {
|
Kirigami.LoadingPlaceholder {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
}
|
}
|
||||||
|
@ -45,7 +44,7 @@ Kirigami.ApplicationWindow {
|
||||||
profile: currentSetupProfile
|
profile: currentSetupProfile
|
||||||
})
|
})
|
||||||
} else {
|
} 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()
|
Component.onCompleted: checkSetup()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue