diff --git a/linphone-app/ui/modules/Common/Animations/BusyIndicator.qml b/linphone-app/ui/modules/Common/Animations/BusyIndicator.qml index 3772b5e98..7237db1d1 100644 --- a/linphone-app/ui/modules/Common/Animations/BusyIndicator.qml +++ b/linphone-app/ui/modules/Common/Animations/BusyIndicator.qml @@ -6,79 +6,85 @@ import Common.Styles 1.0 // ============================================================================= BusyIndicator { - id: busyIndicator - - // --------------------------------------------------------------------------- - - property color color: BusyIndicatorStyle.color - - readonly property int _rotation: 360 - readonly property int _size: width < height ? width : height - - // --------------------------------------------------------------------------- - - visible: running - - contentItem: Item { - x: parent.width / 2 - width / 2 - y: parent.height / 2 - height / 2 - - height: _size - width: _size - - Item { - id: item - - height: parent.height - width: parent.width - - // ----------------------------------------------------------------------- - // Animation. - // ----------------------------------------------------------------------- - - RotationAnimator { - duration: BusyIndicatorStyle.duration - loops: Animation.Infinite - running: true - target: item - - from: 0 - to: busyIndicator._rotation - } - - // ----------------------------------------------------------------------- - // Items to draw. - // ----------------------------------------------------------------------- - - Repeater { - id: repeater - - model: BusyIndicatorStyle.nSpheres - - Rectangle { - x: item.width / 2 - width / 2 - y: item.height / 2 - height / 2 - - height: item.height / 3 - width: item.width / 3 - - color: busyIndicator.color - radius: (width > height ? width : height) / 2 - - transform: [ - Translate { - y: busyIndicator._size / 2 - }, - Rotation { - angle: index / repeater.count * busyIndicator._rotation - origin { - x: width / 2 - y: height / 2 - } - } - ] - } - } - } - } + id: busyIndicator + + // --------------------------------------------------------------------------- + + property color color: BusyIndicatorStyle.color + + readonly property int _rotation: 360 + readonly property int _size: width < height ? width : height + + // --------------------------------------------------------------------------- + + visible: running + + contentItem: Item { + x: parent.width / 2 - width / 2 + y: parent.height / 2 - height / 2 + + height: _size + width: _size + + Item { + id: item + + height: parent.height + width: parent.width + opacity: busyIndicator.running ? 1 : 0 + // ----------------------------------------------------------------------- + // Animation. + // ----------------------------------------------------------------------- + + Behavior on opacity { + OpacityAnimator { + duration: 250 + } + } + + RotationAnimator { + duration: BusyIndicatorStyle.duration + loops: Animation.Infinite + running: busyIndicator.visible + target: item + + from: 0 + to: busyIndicator._rotation + } + + // ----------------------------------------------------------------------- + // Items to draw. + // ----------------------------------------------------------------------- + + Repeater { + id: repeater + + model: BusyIndicatorStyle.nSpheres + + Rectangle { + x: item.width / 2 - width / 2 + y: item.height / 2 - height / 2 + + height: item.height / 3 + width: item.width / 3 + + color: busyIndicator.color + radius: (width > height ? width : height) / 2 + + transform: [ + Translate { + y: busyIndicator._size / 2 + }, + Rotation { + angle: index / repeater.count * busyIndicator._rotation + origin { + x: width / 2 + y: height / 2 + } + } + ] + } + } + } + } }