nosignal-shell/modules/controlcenter/ControlCenter.qml
2025-08-07 15:38:17 +10:00

74 lines
1.8 KiB
QML

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 bool floating
readonly property int rounding: floating ? 0 : Appearance.rounding.normal
property alias active: session.active
property alias navExpanded: session.navExpanded
readonly property Session session: Session {
id: session
root: root
}
function close(): void {
}
implicitWidth: implicitHeight * Config.controlCenter.sizes.ratio
implicitHeight: screen.height * Config.controlCenter.sizes.heightMult
RowLayout {
anchors.fill: parent
spacing: 0
StyledRect {
Layout.fillHeight: true
topLeftRadius: root.rounding
bottomLeftRadius: root.rounding
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
screen: root.screen
session: root.session
}
}
Panes {
Layout.fillWidth: true
Layout.fillHeight: true
topRightRadius: root.rounding
bottomRightRadius: root.rounding
session: root.session
}
}
}