diff --git a/src/StatusQ/Controls/StatusProgressBar.qml b/src/StatusQ/Controls/StatusProgressBar.qml index 6c7fd727..93ed55aa 100644 --- a/src/StatusQ/Controls/StatusProgressBar.qml +++ b/src/StatusQ/Controls/StatusProgressBar.qml @@ -34,10 +34,24 @@ ProgressBar { radius: 5 StatusBaseText { + id: textItem anchors.centerIn: parent + property bool _fittedInBar: width < bar.width ? true : false text: control.text font.pixelSize: 12 color: Theme.palette.indirectColor1 + Component.onCompleted: opacity = width < bar.width ? 1 : 0 + on_FittedInBarChanged: { + if (_fittedInBar && opacity == 0) { + fadeIn.start(); + } + else if (!_fittedInBar) { + fadeIn.stop(); + opacity = 0; + } + } + + OpacityAnimator { id: fadeIn; target: textItem; from: 0; to: 1; duration: 250 } } } }