69 lines
2.6 KiB
QML
Executable File
69 lines
2.6 KiB
QML
Executable File
import QtQuick 2.12
|
|
import QtQuick.Controls 2.12
|
|
|
|
|
|
BusyIndicator {
|
|
id: busy_indicator
|
|
|
|
running: false
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
width: 120
|
|
height: width // Par principe, la forme est carrée...
|
|
contentItem: Item {
|
|
x: parent.width / 2
|
|
y: parent.height / 2
|
|
width: parent.width
|
|
height: parent.height
|
|
|
|
Item {
|
|
id: item
|
|
|
|
width: parent.width
|
|
height: parent.height
|
|
opacity: busy_indicator.running ? 1 : 0
|
|
|
|
Behavior on opacity { // Permet l'apparition et la disparition progressive du BI
|
|
OpacityAnimator {
|
|
duration: 250
|
|
}
|
|
}
|
|
|
|
RotationAnimator { // Donne le mouvement de rotation de l'ensemble des points
|
|
target: item
|
|
running: true
|
|
from: 0
|
|
to: 360
|
|
loops: Animation.Infinite
|
|
duration: 1000 // Durée d'un tour complet
|
|
}
|
|
|
|
Repeater {
|
|
id: repeater
|
|
model: 7 // Nombre de points formant le BI
|
|
|
|
Rectangle {
|
|
x: (item.width / 2) - (width / 2)
|
|
y: (item.height / 2) - (height / 2)
|
|
implicitWidth: item.width / 5 // Largeur du point
|
|
implicitHeight: item.height / 5 // Hauteur du point
|
|
radius: implicitWidth / 2 // Donne la forme circulaire du point
|
|
color: shipheart_couleur_fond_boite_dialogue_niveau_0 // Couleur du point
|
|
opacity: (index + 1) / (repeater.count + 1) // Donne l'opacité variable des points
|
|
transform: [
|
|
Translate {
|
|
y: -(Math.min(item.width, item.height) / 2) + (width / 2) // Permet de positionner le premier point en haut et au centre de la zone
|
|
},
|
|
Rotation {
|
|
angle: (index / repeater.count) * 360 // Tourne de x° en fonction de l'index
|
|
origin.x: width / 2 // Le centre de rotation est le centre de la zone
|
|
origin.y: height / 2
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|