Files
monoshell/Widgets/PercentIndicator.qml
T

41 lines
1.1 KiB
QML

import Quickshell
import QtQuick.Shapes
import Quickshell.Services.Pipewire
import QtQuick
Shape {
id: percentIndicator
preferredRendererType: Shape.CurveRenderer
property var percent
ShapePath {
capStyle: ShapePath.RoundCap
fillColor: "transparent"
strokeColor: "#333"
strokeWidth: 2
PathAngleArc {
moveToStart: true
centerX: percentIndicator.width/2
centerY: percentIndicator.height/2
radiusX: percentIndicator.width/2
radiusY: percentIndicator.height/2
startAngle: 90 + 40
sweepAngle: 360 - 80
}
}
ShapePath {
capStyle: ShapePath.RoundCap
fillColor: "transparent"
strokeColor: "white"
strokeWidth: 2
PathAngleArc {
moveToStart: true
centerX: percentIndicator.width/2
centerY: percentIndicator.height/2
radiusX: percentIndicator.width/2 - 1
radiusY: percentIndicator.height/2 - 1
startAngle: 90 + 40
sweepAngle: percentIndicator.percent * (360 - 80)
}
}
}