mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-05 12:21:59 +02:00
[Panorama Viewer] Loading indicator added
This commit is contained in:
parent
1c3fbaa6e1
commit
3fe862834e
2 changed files with 28 additions and 4 deletions
|
@ -18,7 +18,21 @@ AliceVision.PanoramaViewer {
|
||||||
// paintedWidth / paintedHeight / status for compatibility with standard Image
|
// paintedWidth / paintedHeight / status for compatibility with standard Image
|
||||||
property int paintedWidth: textureSize.width
|
property int paintedWidth: textureSize.width
|
||||||
property int paintedHeight: textureSize.height
|
property int paintedHeight: textureSize.height
|
||||||
property var status: Image.Null
|
property var status: {
|
||||||
|
if (readyToLoad === Image.Ready && root.imagesLoaded === root.pathList.length) {
|
||||||
|
for (var i = 0; i < repeater.model; i++) {
|
||||||
|
if (repeater.itemAt(i).item.status !== Image.Ready) return Image.Loading;
|
||||||
|
}
|
||||||
|
return Image.Ready;
|
||||||
|
}
|
||||||
|
else if (readyToLoad === Image.Ready) {
|
||||||
|
return Image.Loading;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return Image.Null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
property var readyToLoad: Image.Null
|
||||||
|
|
||||||
// Value from ui button
|
// Value from ui button
|
||||||
property int downscaleValueQML: 0
|
property int downscaleValueQML: 0
|
||||||
|
@ -195,6 +209,7 @@ AliceVision.PanoramaViewer {
|
||||||
|
|
||||||
property var pathList : []
|
property var pathList : []
|
||||||
property var idList : []
|
property var idList : []
|
||||||
|
property int imagesLoaded: 0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: panoImages
|
id: panoImages
|
||||||
|
@ -205,7 +220,7 @@ AliceVision.PanoramaViewer {
|
||||||
id: imgPano
|
id: imgPano
|
||||||
Loader {
|
Loader {
|
||||||
id: floatOneLoader
|
id: floatOneLoader
|
||||||
active: root.status
|
active: root.readyToLoad
|
||||||
visible: (floatOneLoader.status === Loader.Ready)
|
visible: (floatOneLoader.status === Loader.Ready)
|
||||||
z:0
|
z:0
|
||||||
//anchors.centerIn: parent
|
//anchors.centerIn: parent
|
||||||
|
@ -226,6 +241,9 @@ AliceVision.PanoramaViewer {
|
||||||
setSource("", {})
|
setSource("", {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
onLoaded: {
|
||||||
|
imagesLoaded++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Repeater {
|
Repeater {
|
||||||
|
@ -237,6 +255,7 @@ AliceVision.PanoramaViewer {
|
||||||
Connections {
|
Connections {
|
||||||
target: root
|
target: root
|
||||||
onImagesDataChanged: {
|
onImagesDataChanged: {
|
||||||
|
root.imagesLoaded = 0;
|
||||||
//We receive the map<ImgPath, idView> from C++
|
//We receive the map<ImgPath, idView> from C++
|
||||||
//Resetting arrays to avoid problem with push
|
//Resetting arrays to avoid problem with push
|
||||||
|
|
||||||
|
@ -255,7 +274,7 @@ AliceVision.PanoramaViewer {
|
||||||
//Changing the repeater model (number of elements)
|
//Changing the repeater model (number of elements)
|
||||||
panoImages.updateRepeater()
|
panoImages.updateRepeater()
|
||||||
|
|
||||||
root.status = Image.Ready;
|
root.readyToLoad = Image.Ready;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -891,7 +891,12 @@ FocusScope {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
// running property binding seems broken, only dynamic binding assignment works
|
// running property binding seems broken, only dynamic binding assignment works
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
running = Qt.binding(function() { return imgContainer.image && imgContainer.image.status === Image.Loading })
|
if (root.usePanoramaViewer) {
|
||||||
|
running = Qt.binding(function() { return imgContainer.panoramaViewerLoader.status === Image.Loading })
|
||||||
|
} else {
|
||||||
|
running = Qt.binding(function() { return imgContainer.image && imgContainer.image.status === Image.Loading })
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// disable the visibility when unused to avoid stealing the mouseEvent to the image color picker
|
// disable the visibility when unused to avoid stealing the mouseEvent to the image color picker
|
||||||
visible: running
|
visible: running
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue