HLoader component, use Loader.asynchronous prop

This commit is contained in:
miruka 2019-08-11 23:25:22 -04:00
parent fbd7c45fe4
commit 5f72397afe
6 changed files with 15 additions and 9 deletions

View File

@ -2,9 +2,6 @@
- `QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling)`
- Refactoring
- Remove clip props when possible
- `property list<thing>`
- See Loader.enabled and async
- Use [Animators](https://doc.qt.io/qt-5/qml-qtquick-animator.html)
- Sendbox
- SignIn/RememberAccount screens

6
src/qml/Base/HLoader.qml Normal file
View File

@ -0,0 +1,6 @@
import QtQuick 2.12
Loader {
asynchronous: true
visible: status == Loader.Ready
}

View File

@ -67,7 +67,7 @@ HBaseButton {
}
}
contentItem: Loader {
contentItem: HLoader {
sourceComponent:
loading && ! iconName ? loadingOverlay : buttonContent
}

View File

@ -18,7 +18,7 @@ HPage {
readonly property bool hasUnknownDevices: false
header: Loader {
header: HLoader {
id: roomHeader
source: ready ? "RoomHeader.qml" : ""
@ -31,7 +31,7 @@ HPage {
page.leftPadding: 0
page.rightPadding: 0
Loader {
HLoader {
source: ready ? "ChatSplitView.qml" : "../Base/HBusyIndicator.qml"
Layout.fillWidth: ready

View File

@ -46,7 +46,7 @@ HPage {
Layout.preferredHeight: childrenRect.height
Loader {
HLoader {
width: parent.width
source: ready ?
modelData :

View File

@ -29,12 +29,15 @@ ApplicationWindow {
Shortcuts { id: shortcuts}
Python { id: py }
Loader {
HLoader {
anchors.fill: parent
source: py.ready ? "" : "LoadingScreen.qml"
}
Loader {
HLoader {
// true makes the initially loaded chat page invisible for some reason
asynchronous: false
id: uiLoader
anchors.fill: parent
scale: py.ready ? 1 : 0.5