63 lines
1.8 KiB
QML
63 lines
1.8 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import QtQuick
|
|
import Quickshell
|
|
import qs.components
|
|
import qs.config
|
|
import qs.modules.launcher.services
|
|
|
|
Item {
|
|
id: root
|
|
|
|
required property ShellScreen screen
|
|
required property DrawerVisibilities visibilities
|
|
required property var panels
|
|
|
|
readonly property bool shouldBeActive: visibilities.launcher && Config.launcher.enabled
|
|
|
|
readonly property real maxHeight: {
|
|
let max = screen.height - Config.border.thickness * 2 - Appearance.spacing.large;
|
|
if (visibilities.dashboard)
|
|
max -= panels.dashboard.nonAnimHeight;
|
|
return max;
|
|
}
|
|
|
|
property real offsetScale: shouldBeActive ? 0 : 1
|
|
|
|
onShouldBeActiveChanged: {
|
|
if (shouldBeActive)
|
|
implicitHeight = Qt.binding(() => content.implicitHeight);
|
|
else
|
|
implicitHeight = implicitHeight; // Break binding during close anim
|
|
}
|
|
|
|
visible: offsetScale < 1
|
|
anchors.bottomMargin: (-implicitHeight - 5) * offsetScale
|
|
implicitHeight: content.implicitHeight
|
|
implicitWidth: content.implicitWidth || 630 // Hard coded fallback for first open
|
|
opacity: 1 - offsetScale
|
|
|
|
Component.onCompleted: Qt.callLater(() => Apps) // Load apps on init
|
|
|
|
Behavior on offsetScale {
|
|
Anim {
|
|
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
|
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
|
}
|
|
}
|
|
|
|
Loader {
|
|
id: content
|
|
|
|
anchors.top: parent.top
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
active: root.shouldBeActive || root.visible
|
|
|
|
sourceComponent: Content {
|
|
visibilities: root.visibilities
|
|
panels: root.panels
|
|
maxHeight: root.maxHeight
|
|
}
|
|
}
|
|
}
|