diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-05 16:19:58 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-05 16:19:58 +1000 |
| commit | fb650907a0b18fab4f996c2fdc110d2d091e4060 (patch) | |
| tree | ab2ec5bb7f17fc36ea9ccc12bad451c43a1b7f9c /modules/controlcenter/ControlCenter.qml | |
| parent | internal: position slider handle correctly (diff) | |
| download | caelestia-shell-fb650907a0b18fab4f996c2fdc110d2d091e4060.tar.gz caelestia-shell-fb650907a0b18fab4f996c2fdc110d2d091e4060.tar.bz2 caelestia-shell-fb650907a0b18fab4f996c2fdc110d2d091e4060.zip | |
internal: rename dcontent -> controlcenter
Diffstat (limited to 'modules/controlcenter/ControlCenter.qml')
| -rw-r--r-- | modules/controlcenter/ControlCenter.qml | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/modules/controlcenter/ControlCenter.qml b/modules/controlcenter/ControlCenter.qml new file mode 100644 index 0000000..2e7ce07 --- /dev/null +++ b/modules/controlcenter/ControlCenter.qml @@ -0,0 +1,61 @@ +pragma ComponentBehavior: Bound + +import qs.components +import qs.components.controls +import qs.services +import qs.config +import Quickshell +import QtQuick +import QtQuick.Layouts + +Item { + id: root + + required property ShellScreen screen + property alias active: session.active + readonly property Session session: Session { + id: session + } + + implicitWidth: implicitHeight * Config.controlCenter.sizes.ratio + implicitHeight: screen.height * Config.controlCenter.sizes.heightMult + + RowLayout { + anchors.fill: parent + + spacing: 0 + + StyledRect { + Layout.fillHeight: true + + topLeftRadius: Appearance.rounding.normal + bottomLeftRadius: Appearance.rounding.normal + implicitWidth: navRail.implicitWidth + color: Colours.palette.m3surfaceContainer + + CustomMouseArea { + anchors.fill: parent + + function onWheel(event: WheelEvent): void { + if (event.angleDelta.y < 0) + root.session.activeIndex = Math.min(root.session.activeIndex + 1, root.session.panes.length - 1); + else if (event.angleDelta.y > 0) + root.session.activeIndex = Math.max(root.session.activeIndex - 1, 0); + } + } + + NavRail { + id: navRail + + session: root.session + } + } + + Panes { + Layout.fillWidth: true + Layout.fillHeight: true + + session: root.session + } + } +} |