[ui] Viewer3D: add loading overlay with BusyIndicator

This commit is contained in:
Yann Lanthony 2018-12-13 17:15:24 +01:00
parent edfc34fbd1
commit 5814a39e3e
2 changed files with 22 additions and 0 deletions

View file

@ -16,6 +16,15 @@ Entity {
property bool pickingEnabled: false
readonly property alias count: instantiator.count // number of instantiated media delegates
/// True while at least one media is being loaded
readonly property bool loading: {
for(var i=0; i<m.mediaModel.count; ++i) {
if(m.mediaModel.get(i).status === SceneLoader.Loading)
return true;
}
return false;
}
signal pressed(var pick)
signal loadRequest(var idx)

View file

@ -214,6 +214,19 @@ FocusScope {
}
}
// Media loading overlay
// (Scene3D is frozen while a media is being loaded)
Rectangle {
anchors.fill: parent
visible: mediaLibrary.loading
color: Qt.darker(Colors.sysPalette.mid, 1.2)
opacity: 0.6
BusyIndicator {
anchors.centerIn: parent
running: parent.visible
}
}
// UI Overlay
Controls1.SplitView {
id: overlaySplitView