From 85d575f6c18017693cb2f3ab07314a0cf43adbe6 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Thu, 18 Sep 2025 15:19:15 +1000 Subject: feat: add sidebar WIP --- modules/sidebar/Wrapper.qml | 66 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 modules/sidebar/Wrapper.qml (limited to 'modules/sidebar/Wrapper.qml') 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 + } + } +} -- cgit v1.2.3-freya