hefty: bar: popup choreography

This commit is contained in:
end-4
2026-03-02 21:55:18 +01:00
parent 521f3cab6d
commit ae0c9f4731
5 changed files with 132 additions and 11 deletions
@@ -0,0 +1,26 @@
pragma ComponentBehavior: Bound
import QtQuick
AbstractChoreographable {
id: root
progress: 0
property bool vertical: true
property bool reverseDirection: false
property real distance: 15
readonly property real directionMultiplier: reverseDirection ? -1 : 1
Component.onCompleted: syncProgress()
onProgressChanged: syncProgress()
function syncProgress() {
const progressDistance = distance * (1 - progress) * directionMultiplier;
root.child.opacity = progress
if (vertical) {
root.child.y = progressDistance
} else {
root.child.x = progressDistance
}
}
}