diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-07 21:06:42 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-07 21:06:42 +1000 |
| commit | 964d5deaa2b3aefd8fa0eb7ce682689b73bafc9f (patch) | |
| tree | bd451c545a480f17e7d9042569e7b339f4ad9c92 | |
| parent | internal: fix transparent transitions (diff) | |
| download | caelestia-shell-964d5deaa2b3aefd8fa0eb7ce682689b73bafc9f.tar.gz caelestia-shell-964d5deaa2b3aefd8fa0eb7ce682689b73bafc9f.tar.bz2 caelestia-shell-964d5deaa2b3aefd8fa0eb7ce682689b73bafc9f.zip | |
controlcenter: hide float button when floating
| -rw-r--r-- | modules/controlcenter/ControlCenter.qml | 2 | ||||
| -rw-r--r-- | modules/controlcenter/NavRail.qml | 105 | ||||
| -rw-r--r-- | modules/controlcenter/Session.qml | 1 | ||||
| -rw-r--r-- | modules/lock/MediaPlaying.qml | 1 |
4 files changed, 56 insertions, 53 deletions
diff --git a/modules/controlcenter/ControlCenter.qml b/modules/controlcenter/ControlCenter.qml index 9a34861..0eeb3bf 100644 --- a/modules/controlcenter/ControlCenter.qml +++ b/modules/controlcenter/ControlCenter.qml @@ -12,9 +12,9 @@ Item { id: root required property ShellScreen screen - property bool floating readonly property int rounding: floating ? 0 : Appearance.rounding.normal + property alias floating: session.floating property alias active: session.active property alias navExpanded: session.navExpanded diff --git a/modules/controlcenter/NavRail.qml b/modules/controlcenter/NavRail.qml index 3c3d7fd..73fa729 100644 --- a/modules/controlcenter/NavRail.qml +++ b/modules/controlcenter/NavRail.qml @@ -80,81 +80,84 @@ Item { } } - StyledRect { - id: normalWinBtn - - readonly property int nonAnimWidth: normalWinIcon.implicitWidth + (root.session.navExpanded ? normalWinLabel.anchors.leftMargin + normalWinLabel.implicitWidth : 0) + normalWinIcon.anchors.leftMargin * 2 + Loader { + asynchronous: true + active: !root.session.floating + visible: active - Layout.bottomMargin: Appearance.spacing.large * 2 + 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 + implicitWidth: nonAnimWidth + implicitHeight: root.session.navExpanded ? normalWinIcon.implicitHeight + Appearance.padding.normal * 2 : nonAnimWidth - color: Colours.palette.m3primaryContainer - radius: Appearance.rounding.small + color: Colours.palette.m3primaryContainer + radius: Appearance.rounding.small - StateLayer { - id: normalWinState + StateLayer { + id: normalWinState - color: Colours.palette.m3onPrimaryContainer + color: Colours.palette.m3onPrimaryContainer - function onClicked(): void { - root.session.root.close(); - WindowFactory.create(null, { - screen: root.screen, - active: root.session.active, - navExpanded: root.session.navExpanded - }); + function onClicked(): void { + root.session.root.close(); + WindowFactory.create(null, { + screen: root.screen, + active: root.session.active, + navExpanded: root.session.navExpanded + }); + } } - } - MaterialIcon { - id: normalWinIcon + MaterialIcon { + id: normalWinIcon - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: Appearance.padding.large + 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 - } + text: "select_window" + color: Colours.palette.m3onPrimaryContainer + font.pointSize: Appearance.font.size.large + fill: 1 + } - StyledText { - id: normalWinLabel + StyledText { + id: normalWinLabel - anchors.left: normalWinIcon.right - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: Appearance.spacing.normal + 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 + 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 opacity { + Anim { + duration: Appearance.anim.durations.small + } } } - } - Behavior on implicitWidth { - Anim { - duration: Appearance.anim.durations.expressiveDefaultSpatial - easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial + 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 + Behavior on implicitHeight { + Anim { + duration: Appearance.anim.durations.expressiveDefaultSpatial + easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial + } } } } NavItem { + Layout.topMargin: Appearance.spacing.large * 2 icon: "network_manage" label: "network" } diff --git a/modules/controlcenter/Session.qml b/modules/controlcenter/Session.qml index 1ee79c8..a143470 100644 --- a/modules/controlcenter/Session.qml +++ b/modules/controlcenter/Session.qml @@ -5,6 +5,7 @@ QtObject { readonly property list<string> panes: ["network", "bluetooth", "audio"] required property var root + property bool floating: false property string active: panes[0] property int activeIndex: 0 property bool navExpanded: false diff --git a/modules/lock/MediaPlaying.qml b/modules/lock/MediaPlaying.qml index 79c454f..a38f0e8 100644 --- a/modules/lock/MediaPlaying.qml +++ b/modules/lock/MediaPlaying.qml @@ -5,7 +5,6 @@ import qs.config import Quickshell.Widgets import QtQuick import QtQuick.Layouts -import QtQuick.Controls RowLayout { id: root |