feat: async components

This commit is contained in:
2 * r + 2 * t 2026-03-20 01:01:56 +11:00
parent 9d36f5c314
commit 52e7e9732b
5 changed files with 10 additions and 0 deletions

View file

@ -83,6 +83,7 @@ Elevation {
} }
Loader { Loader {
asynchronous: true
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
active: item.modelData.trailingIcon.length > 0 active: item.modelData.trailingIcon.length > 0
visible: active visible: active

View file

@ -74,6 +74,7 @@ StyledRect {
} }
Loader { Loader {
asynchronous: true
active: !!root.label active: !!root.label
visible: active visible: active
@ -101,6 +102,8 @@ StyledRect {
// Tooltip - positioned absolutely, doesn't affect layout // Tooltip - positioned absolutely, doesn't affect layout
Loader { Loader {
id: tooltipLoader id: tooltipLoader
asynchronous: true
active: root.tooltip !== "" active: root.tooltip !== ""
z: 10000 z: 10000
width: 0 width: 0

View file

@ -47,6 +47,7 @@ Item {
} }
Loader { Loader {
asynchronous: true
anchors.centerIn: parent anchors.centerIn: parent
opacity: view.count === 0 ? 1 : 0 opacity: view.count === 0 ? 1 : 0

View file

@ -75,6 +75,7 @@ StyledRect {
spacing: 0 spacing: 0
Loader { Loader {
asynchronous: true
Layout.rightMargin: Appearance.spacing.small Layout.rightMargin: Appearance.spacing.small
active: folder.index > 0 active: folder.index > 0
sourceComponent: StyledText { sourceComponent: StyledText {
@ -89,6 +90,7 @@ StyledRect {
implicitHeight: folderName.implicitHeight + Appearance.padding.small * 2 implicitHeight: folderName.implicitHeight + Appearance.padding.small * 2
Loader { Loader {
asynchronous: true
anchors.fill: parent anchors.fill: parent
active: folder.index < root.dialog.cwd.length - 1 active: folder.index < root.dialog.cwd.length - 1
sourceComponent: StateLayer { sourceComponent: StateLayer {
@ -103,6 +105,8 @@ StyledRect {
Loader { Loader {
id: homeIcon id: homeIcon
asynchronous: true
anchors.left: parent.left anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: Appearance.padding.normal anchors.leftMargin: Appearance.padding.normal

View file

@ -18,6 +18,7 @@ Item {
Loader { Loader {
id: loader id: loader
asynchronous: true
anchors.fill: parent anchors.fill: parent
sourceComponent: root.source ? root.source.toString().startsWith("image://icon/") ? iconImage : cachingImage : null sourceComponent: root.source ? root.source.toString().startsWith("image://icon/") ? iconImage : cachingImage : null
} }