Splash: lazy load login screen

This commit is contained in:
2024-02-13 19:28:43 -03:00
parent a88b4fb166
commit 9c6410ebe7

View File

@@ -5,6 +5,7 @@ import QtQuick.Controls
import "PStyle" import "PStyle"
import "Login" import "Login"
import "."
Window { Window {
visible: true visible: true
@@ -12,11 +13,46 @@ Window {
height: 480 height: 480
title: Qt.application.displayName title: Qt.application.displayName
PBackground { Component.onCompleted: {
anchors.fill: parent App.setup()
loadingTimer.running = true
}
Login { Timer {
id: loadingTimer
running: false
repeat: false
interval: 500
onTriggered: loader.source = "qrc:/Login/Login.qml"
}
Loader {
id: loader
anchors.fill: parent
sourceComponent: loadingComponent
}
Component {
id: loadingComponent
PBackground {
ColumnLayout {
anchors.centerIn: parent anchors.centerIn: parent
spacing: 24
PBusyIndicator {
Layout.alignment: Qt.AlignHCenter
Layout.preferredHeight: 48
running: true
}
PText {
Layout.alignment: Qt.AlignHCenter
text: qsTr("Loading application...")
}
}
} }
} }
} }