From fb650907a0b18fab4f996c2fdc110d2d091e4060 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 5 Aug 2025 16:19:58 +1000 Subject: internal: rename dcontent -> controlcenter --- modules/controlcenter/ControlCenter.qml | 61 +++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 modules/controlcenter/ControlCenter.qml (limited to 'modules/controlcenter/ControlCenter.qml') 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 + } + } +} -- cgit v1.2.3-freya