From 28dd35fc1b016fa39faf37242aaf89601f3c7fd8 Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 6 Nov 2019 10:08:55 -0400 Subject: [PATCH] Indeterminate progress bar styling --- TODO.md | 1 - src/qml/Base/HProgressBar.qml | 12 +++++++++++- src/qml/Chat/UploadsBar.qml | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/TODO.md b/TODO.md index 84126b86..abe6afe1 100644 --- a/TODO.md +++ b/TODO.md @@ -58,7 +58,6 @@ - UI - Show error if uploading avatar fails or file is corrupted - Way to open context menus without a right mouse button - - Indeterminate progress bar - `smartVerticalFlick()` gradual acceleration - Link previews diff --git a/src/qml/Base/HProgressBar.qml b/src/qml/Base/HProgressBar.qml index 998f5c76..1c20e70f 100644 --- a/src/qml/Base/HProgressBar.qml +++ b/src/qml/Base/HProgressBar.qml @@ -18,9 +18,19 @@ ProgressBar { implicitHeight: theme.controls.progressBar.height Rectangle { - width: bar.visualPosition * parent.width + id: indicator + width: bar.indeterminate ? + parent.width / 8 : bar.visualPosition * parent.width height: parent.height color: foregroundColor + + XAnimator on x { + running: indeterminate + duration: theme.animationDuration * 8 + from: 0 + to: bar.width - indicator.width + onStopped: {[from, to] = [to, from]; start()} + } } } } diff --git a/src/qml/Chat/UploadsBar.qml b/src/qml/Chat/UploadsBar.qml index a94640b8..2ed9b6d4 100644 --- a/src/qml/Chat/UploadsBar.qml +++ b/src/qml/Chat/UploadsBar.qml @@ -97,7 +97,7 @@ Rectangle { HProgressBar { id: progressBar - + indeterminate: true Layout.fillWidth: true } }