Index: sources/gui/qml/components/Circle.qml =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r68757118f0b5dc5d831f8330ff3fec40dc461aa9 --- sources/gui/qml/components/Circle.qml (.../Circle.qml) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/gui/qml/components/Circle.qml (.../Circle.qml) (revision 68757118f0b5dc5d831f8330ff3fec40dc461aa9) @@ -16,6 +16,7 @@ // Qt import QtQuick 2.12 import QtQuick.Shapes 1.12 +import QtGraphicalEffects 1.0 // Project @@ -29,6 +30,7 @@ Item { id: _root property alias thickness : _path.strokeWidth property alias color : _path.strokeColor + property alias shape : _shape property alias shadow : _rectangle.border property int shadowEdge : 1 property alias fillColor : _rectangle.color @@ -39,6 +41,10 @@ property real diameter : Variables.circleNormalDiameter + property bool showGradient : false + property bool runAnimation : false + property color startGradientColor : _root.color + width : diameter height : diameter @@ -62,6 +68,7 @@ strokeColor: Colors.borderButton strokeWidth: 1 capStyle: ShapePath.RoundCap + PathAngleArc { id: _arc centerX: _root.width / 2 centerY: _root.height / 2 @@ -72,5 +79,45 @@ } } } + + ConicalGradient { + id: borderGradient + + anchors.fill: _shape + angle: -5 + source: _shape + + gradient: Gradient { + GradientStop { position: 0.4; color: showGradient ? _root.startGradientColor :_root.color } + GradientStop { position: 1.0; color: _root.color } + } + } + + OpacityAnimator { target: borderGradient + from : 0.2 + to : 1 + duration : 1000 + running : ! runAnimation + onFinished : { + var tmp = from + from = to + to = tmp + ! runAnimation ? restart() : target.opacity = 1 + } + } + + OpacityAnimator { target: _shape + from : 0.2 + to : 1 + duration : 1000 + running : ! runAnimation + onFinished : { + var tmp = from + from = to + to = tmp + ! runAnimation ? restart() : target.opacity = 1 + } + } + } }