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 "Login"
import "."
Window {
visible: true
@@ -12,11 +13,46 @@ Window {
height: 480
title: Qt.application.displayName
PBackground {
anchors.fill: parent
Component.onCompleted: {
App.setup()
loadingTimer.running = true
}
Login {
anchors.centerIn: parent
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
spacing: 24
PBusyIndicator {
Layout.alignment: Qt.AlignHCenter
Layout.preferredHeight: 48
running: true
}
PText {
Layout.alignment: Qt.AlignHCenter
text: qsTr("Loading application...")
}
}
}
}
}