HLoader component, use Loader.asynchronous prop
This commit is contained in:
parent
fbd7c45fe4
commit
5f72397afe
3
TODO.md
3
TODO.md
|
@ -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
6
src/qml/Base/HLoader.qml
Normal file
|
@ -0,0 +1,6 @@
|
|||
import QtQuick 2.12
|
||||
|
||||
Loader {
|
||||
asynchronous: true
|
||||
visible: status == Loader.Ready
|
||||
}
|
|
@ -67,7 +67,7 @@ HBaseButton {
|
|||
}
|
||||
}
|
||||
|
||||
contentItem: Loader {
|
||||
contentItem: HLoader {
|
||||
sourceComponent:
|
||||
loading && ! iconName ? loadingOverlay : buttonContent
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -46,7 +46,7 @@ HPage {
|
|||
|
||||
Layout.preferredHeight: childrenRect.height
|
||||
|
||||
Loader {
|
||||
HLoader {
|
||||
width: parent.width
|
||||
source: ready ?
|
||||
modelData :
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user