Fix bg tracking, use slow spatial for detach, default spatial for everything else, adjust deform, move instead of width scale
55 lines
1.2 KiB
QML
55 lines
1.2 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import QtQuick
|
|
import Quickshell
|
|
import qs.components
|
|
import qs.config
|
|
|
|
Item {
|
|
id: root
|
|
|
|
required property ShellScreen screen
|
|
|
|
readonly property alias content: content
|
|
property real offsetScale: x > 0 || content.hasCurrent ? 0 : 1
|
|
|
|
visible: width > 0 && height > 0
|
|
clip: true
|
|
|
|
implicitWidth: content.implicitWidth * (1 - offsetScale)
|
|
implicitHeight: content.implicitHeight
|
|
|
|
Behavior on offsetScale {
|
|
Anim {
|
|
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
|
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
|
}
|
|
}
|
|
|
|
Behavior on x {
|
|
Anim {
|
|
duration: content.animLength
|
|
easing.bezierCurve: content.animCurve
|
|
}
|
|
}
|
|
|
|
Behavior on y {
|
|
enabled: root.offsetScale < 1
|
|
|
|
Anim {
|
|
duration: content.animLength
|
|
easing.bezierCurve: content.animCurve
|
|
}
|
|
}
|
|
|
|
Wrapper {
|
|
id: content
|
|
|
|
screen: root.screen
|
|
offsetScale: root.offsetScale
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
anchors.left: parent.left
|
|
anchors.leftMargin: (-implicitWidth - 5) * root.offsetScale
|
|
}
|
|
}
|