[vlc-devel] [PATCH 2/2] qt: ProgressBar: Use indeterminate mode during discovery/reload

Hugo Beauzée-Luyssen hugo at beauzee.fr
Wed Jun 26 18:27:30 CEST 2019


Otherwise the progress bar can flicker as more files are found
---
 modules/gui/qt/qml/utils/ScanProgressBar.qml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/qml/utils/ScanProgressBar.qml b/modules/gui/qt/qml/utils/ScanProgressBar.qml
index 1e1bf1e22f..7b298110c4 100644
--- a/modules/gui/qt/qml/utils/ScanProgressBar.qml
+++ b/modules/gui/qt/qml/utils/ScanProgressBar.qml
@@ -35,10 +35,12 @@ ProgressBar {
             progressText_id.text = entryPoint;
         }
         onDiscoveryStarted: discoveryDone = false
+        onReloadStarted: discoveryDone = false
         onDiscoveryCompleted: discoveryDone = true
+        onReloadCompleted: discoveryDone = true
     }
 
-    visible: (progressPercent < 100) && (progressPercent != 0)
+    visible: ((progressPercent < 100) && (progressPercent != 0)) || !discoveryDone
     id: progressBar_id
     from: 0
     to: 100
@@ -46,9 +48,12 @@ ProgressBar {
     anchors.topMargin: 10
     anchors.bottomMargin: 10
     value: progressPercent
+    indeterminate: !discoveryDone
     Text {
         id: progressText_id
         color: VLCStyle.colors.text
+        z: progressBar_id.z + 1
         anchors.horizontalCenter: parent.horizontalCenter
+        visible: true
     }
 }
-- 
2.20.1



More information about the vlc-devel mailing list