Fix progress bar indeterminate ←→ normal switching

This commit is contained in:
miruka 2019-11-12 18:22:57 -04:00
parent 7e5bd5299e
commit f727645342

View File

@ -25,11 +25,17 @@ ProgressBar {
color: foregroundColor
XAnimator on x {
running: indeterminate
running: bar.indeterminate
duration: theme.animationDuration * 8
from: 0
to: bar.width - indicator.width
onStopped: {[from, to] = [to, from]; start()}
onStopped: if (bar.indeterminate) {
[from, to] = [to, from];
start()
} else {
indicator.x = 0
}
}
}
}