summaryrefslogtreecommitdiff
path: root/modules/sidebar/Wrapper.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-18 15:19:15 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-18 15:19:15 +1000
commit85d575f6c18017693cb2f3ab07314a0cf43adbe6 (patch)
tree89540859a71162c28c8419af49c75cc3634e6b70 /modules/sidebar/Wrapper.qml
parentlauncher: fix open anim (diff)
downloadcaelestia-shell-85d575f6c18017693cb2f3ab07314a0cf43adbe6.tar.gz
caelestia-shell-85d575f6c18017693cb2f3ab07314a0cf43adbe6.tar.bz2
caelestia-shell-85d575f6c18017693cb2f3ab07314a0cf43adbe6.zip
feat: add sidebar
WIP
Diffstat (limited to 'modules/sidebar/Wrapper.qml')
-rw-r--r--modules/sidebar/Wrapper.qml66
1 files changed, 66 insertions, 0 deletions
diff --git a/modules/sidebar/Wrapper.qml b/modules/sidebar/Wrapper.qml
new file mode 100644
index 0000000..ddbb39c
--- /dev/null
+++ b/modules/sidebar/Wrapper.qml
@@ -0,0 +1,66 @@
+pragma ComponentBehavior: Bound
+
+import qs.components
+import qs.config
+import QtQuick
+
+Item {
+ id: root
+
+ required property var visibilities
+ required property var panels
+
+ visible: width > 0
+ implicitWidth: 0
+ implicitHeight: 0
+
+ states: State {
+ name: "visible"
+ when: root.visibilities.sidebar && Config.sidebar.enabled
+
+ PropertyChanges {
+ root.implicitWidth: Config.sidebar.sizes.width
+ }
+ }
+
+ transitions: [
+ Transition {
+ from: ""
+ to: "visible"
+
+ Anim {
+ target: root
+ property: "implicitWidth"
+ duration: Appearance.anim.durations.expressiveDefaultSpatial
+ easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
+ }
+ },
+ Transition {
+ from: "visible"
+ to: ""
+
+ Anim {
+ target: root
+ property: "implicitWidth"
+ easing.bezierCurve: root.panels.osd.width > 0 || root.panels.session.width > 0 ? Appearance.anim.curves.expressiveDefaultSpatial : Appearance.anim.curves.emphasized
+ }
+ }
+ ]
+
+ Loader {
+ id: content
+
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: Appearance.padding.large
+
+ visible: false
+ active: true
+ Component.onCompleted: active = Qt.binding(() => (root.visibilities.sidebar && Config.sidebar.enabled) || root.visible)
+
+ sourceComponent: Content {
+ visibilities: root.visibilities
+ }
+ }
+}