This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
powersync-app/nymea-app/ui/components/ActivityIndicator.qml
2022-08-22 13:59:04 +02:00

53 lines
1.5 KiB
QML

import QtQuick 2.0
import Nymea 1.0
Item {
id: root
property color color: Style.iconColor
implicitWidth: Style.iconSize
implicitHeight: Style.iconSize
property int dotSize: width / 6
property bool running: true
Grid {
id: grid
columns: 3
anchors.fill: parent
spacing: (width - columns * root.dotSize) / (columns - 1)
Repeater {
id: dotRepeater
model: Math.pow(grid.columns, 2)
delegate: Rectangle {
id: dot
width: root.dotSize
height: width
color: root.color
property int duration: 400
property int row: Math.floor(index / grid.columns)
property int pause: row * 200
SequentialAnimation {
running: root.running && root.visible
loops: Animation.Infinite
PauseAnimation { duration: dot.pause }
NumberAnimation {
target: dot
property: "opacity"
from: 0.2; to: 1;
duration: dot.duration
}
NumberAnimation {
target: dot
property: "opacity"
from: 1; to: 0.2;
duration: dot.duration
}
}
}
}
}
}