diff options
| author | ATMDA <atdma2600@gmail.com> | 2025-11-16 14:53:20 -0500 |
|---|---|---|
| committer | ATMDA <atdma2600@gmail.com> | 2025-11-16 14:53:20 -0500 |
| commit | 8a33ad990511d7cce8c68ee416e6999cfa9b8477 (patch) | |
| tree | 2f4ceea4d7462593becb8b40d81d3ac006163b80 /modules/controlcenter | |
| parent | revert to 007e94a: restore caching and lazy loading features (diff) | |
| download | caelestia-shell-8a33ad990511d7cce8c68ee416e6999cfa9b8477.tar.gz caelestia-shell-8a33ad990511d7cce8c68ee416e6999cfa9b8477.tar.bz2 caelestia-shell-8a33ad990511d7cce8c68ee416e6999cfa9b8477.zip | |
controlcenter: restored floating window toggle
Diffstat (limited to 'modules/controlcenter')
| -rw-r--r-- | modules/controlcenter/NavRail.qml | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/modules/controlcenter/NavRail.qml b/modules/controlcenter/NavRail.qml index 8432f17..d1d432d 100644 --- a/modules/controlcenter/NavRail.qml +++ b/modules/controlcenter/NavRail.qml @@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound import qs.components import qs.services import qs.config +import qs.modules.controlcenter import Quickshell import QtQuick import QtQuick.Layouts @@ -39,6 +40,82 @@ Item { } } + Loader { + Layout.topMargin: Appearance.spacing.large + asynchronous: true + active: !root.session.floating + visible: active + + sourceComponent: StyledRect { + readonly property int nonAnimWidth: normalWinIcon.implicitWidth + (root.session.navExpanded ? normalWinLabel.anchors.leftMargin + normalWinLabel.implicitWidth : 0) + normalWinIcon.anchors.leftMargin * 2 + + implicitWidth: nonAnimWidth + implicitHeight: root.session.navExpanded ? normalWinIcon.implicitHeight + Appearance.padding.normal * 2 : nonAnimWidth + + color: Colours.palette.m3primaryContainer + radius: Appearance.rounding.small + + StateLayer { + id: normalWinState + + color: Colours.palette.m3onPrimaryContainer + + function onClicked(): void { + root.session.root.close(); + WindowFactory.create(null, { + active: root.session.active, + navExpanded: root.session.navExpanded + }); + } + } + + MaterialIcon { + id: normalWinIcon + + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + anchors.leftMargin: Appearance.padding.large + + text: "select_window" + color: Colours.palette.m3onPrimaryContainer + font.pointSize: Appearance.font.size.large + fill: 1 + } + + StyledText { + id: normalWinLabel + + anchors.left: normalWinIcon.right + anchors.verticalCenter: parent.verticalCenter + anchors.leftMargin: Appearance.spacing.normal + + text: qsTr("Float window") + color: Colours.palette.m3onPrimaryContainer + opacity: root.session.navExpanded ? 1 : 0 + + Behavior on opacity { + Anim { + duration: Appearance.anim.durations.small + } + } + } + + Behavior on implicitWidth { + Anim { + duration: Appearance.anim.durations.expressiveDefaultSpatial + easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial + } + } + + Behavior on implicitHeight { + Anim { + duration: Appearance.anim.durations.expressiveDefaultSpatial + easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial + } + } + } + } + NavItem { Layout.topMargin: Appearance.spacing.large * 2 icon: "router" |