nosignal-shell/modules/session/Wrapper.qml
2 * r + 2 * t 158588ce89 refactor: no need to explicitly type as default spatial
Default spatial is the default type, so no need to type anims as such
2026-04-23 03:47:56 +10:00

40 lines
1 KiB
QML

pragma ComponentBehavior: Bound
import QtQuick
import Caelestia.Config
import qs.components
Item {
id: root
required property DrawerVisibilities visibilities
required property bool sidebarVisible
readonly property real nonAnimWidth: content.implicitWidth
readonly property bool shouldBeActive: visibilities.session && Config.session.enabled
property real offsetScale: shouldBeActive ? 0 : 1
property real sidebarOffset: sidebarVisible ? 14 : 0
visible: offsetScale < 1
anchors.rightMargin: (-implicitWidth - 5 - sidebarOffset) * offsetScale
implicitWidth: content.implicitWidth
implicitHeight: content.implicitHeight || 510 // Hard coded fallback for first open
opacity: 1 - offsetScale
Behavior on offsetScale {
Anim {}
}
Loader {
id: content
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
active: root.shouldBeActive || root.visible
sourceComponent: Content {
visibilities: root.visibilities
}
}
}