[vlc-commits] qml: extend BusyIndicator

Pierre Lamot git at videolan.org
Thu Oct 31 01:02:24 CET 2019


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Mon Oct 21 18:08:58 2019 +0200| [7bb6fc6104a0df9d6a1e0abd54563a80417878ed] | committer: Jean-Baptiste Kempf

qml: extend BusyIndicator

* use VLC color scheme
  * allow the indicator to be visible only after the state has been active
    long enough

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7bb6fc6104a0df9d6a1e0abd54563a80417878ed
---

 modules/gui/qt/Makefile.am                    |  1 +
 modules/gui/qt/qml/utils/BusyIndicatorExt.qml | 46 +++++++++++++++++++++++++++
 modules/gui/qt/vlc.qrc                        |  1 +
 3 files changed, 48 insertions(+)

diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am
index 0207cbaddc..8be60f944e 100644
--- a/modules/gui/qt/Makefile.am
+++ b/modules/gui/qt/Makefile.am
@@ -585,6 +585,7 @@ libqt_plugin_la_QML = \
 	gui/qt/qml/dialogs/EditorTabButton.qml \
 	gui/qt/qml/dialogs/ToolbarEditorButtonList.qml \
 	gui/qt/qml/dialogs/ToolbarEditor.qml \
+	gui/qt/qml/utils/BusyIndicatorExt.qml \
 	gui/qt/qml/utils/DNDLabel.qml \
 	gui/qt/qml/utils/ToolTipArea.qml \
 	gui/qt/qml/utils/DrawerExt.qml \
diff --git a/modules/gui/qt/qml/utils/BusyIndicatorExt.qml b/modules/gui/qt/qml/utils/BusyIndicatorExt.qml
new file mode 100644
index 0000000000..1c73f22300
--- /dev/null
+++ b/modules/gui/qt/qml/utils/BusyIndicatorExt.qml
@@ -0,0 +1,46 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * ( at your option ) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+import QtQuick 2.11
+import QtQuick.Controls 2.4
+import "qrc:///style/"
+
+BusyIndicator {
+    id: control
+
+    palette.text: VLCStyle.colors.text
+    running: false
+
+    property int delay: 1000 //ms
+    property bool runningDelayed: false
+    onRunningDelayedChanged: {
+        if (runningDelayed) {
+            controlDelay.start()
+        } else {
+            controlDelay.stop()
+            control.running = false
+        }
+    }
+
+    Timer {
+        id: controlDelay
+        interval: control.delay
+        running: false
+        repeat: false
+        onTriggered: control.running = true
+    }
+}
diff --git a/modules/gui/qt/vlc.qrc b/modules/gui/qt/vlc.qrc
index 52c9600aa4..bce3ebfe25 100644
--- a/modules/gui/qt/vlc.qrc
+++ b/modules/gui/qt/vlc.qrc
@@ -176,6 +176,7 @@
         <file alias="MainInterface.qml">qml/MainInterface.qml</file>
     </qresource>
     <qresource prefix="/utils">
+        <file alias="BusyIndicatorExt.qml">qml/utils/BusyIndicatorExt.qml</file>
         <file alias="MultiCoverPreview.qml">qml/utils/MultiCoverPreview.qml</file>
         <file alias="GridItem.qml">qml/utils/GridItem.qml</file>
         <file alias="ListItem.qml">qml/utils/ListItem.qml</file>



More information about the vlc-commits mailing list