sick ass animation for forceHidden

This commit is contained in:
2026-08-08 17:08:45 +01:00
parent 02e99cca74
commit d97a6e0a48

View File

@@ -65,6 +65,46 @@ Item {
spring: 4 spring: 4
} }
} }
Behavior on implicitWidth {
SpringAnimation {
damping: 0.3
spring: 4
}
}
onForceHiddenChanged: {
if (root.forceHidden == true) {
hideTimer.restart();
} else {
root.implicitWidth = root.boxWidth;
root.visible = true;
}
}
Timer {
id: hideTimer
interval: 250
repeat: false
running: false
onTriggered: {
root.implicitWidth = 0;
subHideTimer.restart();
}
}
Timer {
id: subHideTimer
interval: 200
repeat: false
running: false
onTriggered: {
root.visible = false;
}
}
anchors { anchors {
top: parent.top top: parent.top