diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-07 16:59:13 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-07 16:59:13 +1000 |
| commit | a9f7d1efc154ee039c47cf37cb48342b08848014 (patch) | |
| tree | 44c4034461d2803d7fdef6dc352b4479de53a0ed /modules/controlcenter | |
| parent | controlcenter: fix navrail colours (diff) | |
| download | caelestia-shell-a9f7d1efc154ee039c47cf37cb48342b08848014.tar.gz caelestia-shell-a9f7d1efc154ee039c47cf37cb48342b08848014.tar.bz2 caelestia-shell-a9f7d1efc154ee039c47cf37cb48342b08848014.zip | |
controlcenter: add header when floating
Diffstat (limited to 'modules/controlcenter')
| -rw-r--r-- | modules/controlcenter/ControlCenter.qml | 21 | ||||
| -rw-r--r-- | modules/controlcenter/WindowFactory.qml | 4 | ||||
| -rw-r--r-- | modules/controlcenter/WindowTitle.qml | 51 |
3 files changed, 73 insertions, 3 deletions
diff --git a/modules/controlcenter/ControlCenter.qml b/modules/controlcenter/ControlCenter.qml index e528389..9a34861 100644 --- a/modules/controlcenter/ControlCenter.qml +++ b/modules/controlcenter/ControlCenter.qml @@ -30,10 +30,27 @@ Item { implicitWidth: implicitHeight * Config.controlCenter.sizes.ratio implicitHeight: screen.height * Config.controlCenter.sizes.heightMult - RowLayout { + GridLayout { anchors.fill: parent - spacing: 0 + rowSpacing: 0 + columnSpacing: 0 + rows: root.floating ? 2 : 1 + columns: 2 + + Loader { + Layout.fillWidth: true + Layout.columnSpan: 2 + + asynchronous: true + active: root.floating + visible: active + + sourceComponent: WindowTitle { + screen: root.screen + session: root.session + } + } StyledRect { Layout.fillHeight: true diff --git a/modules/controlcenter/WindowFactory.qml b/modules/controlcenter/WindowFactory.qml index 75550c3..f5c6b73 100644 --- a/modules/controlcenter/WindowFactory.qml +++ b/modules/controlcenter/WindowFactory.qml @@ -38,6 +38,8 @@ Singleton { implicitWidth: cc.implicitWidth implicitHeight: cc.implicitHeight + title: qsTr("Caelestia Settings - %1").arg(cc.active.slice(0, 1).toUpperCase() + cc.active.slice(1)) + ControlCenter { id: cc @@ -46,7 +48,7 @@ Singleton { floating: true function close(): void { - win.visible = false; + win.destroy(); } } diff --git a/modules/controlcenter/WindowTitle.qml b/modules/controlcenter/WindowTitle.qml new file mode 100644 index 0000000..35af9a1 --- /dev/null +++ b/modules/controlcenter/WindowTitle.qml @@ -0,0 +1,51 @@ +import qs.components +import qs.services +import qs.config +import Quickshell +import QtQuick + +StyledRect { + id: root + + required property ShellScreen screen + required property Session session + + implicitHeight: text.implicitHeight + Appearance.padding.normal + color: Colours.palette.m3surfaceContainer + + StyledText { + id: text + + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + + text: qsTr("Caelestia Settings - %1").arg(root.session.active) + font.capitalization: Font.Capitalize + font.pointSize: Appearance.font.size.larger + font.weight: 500 + } + + Item { + anchors.right: parent.right + anchors.top: parent.top + anchors.margins: Appearance.padding.normal + + implicitWidth: implicitHeight + implicitHeight: closeIcon.implicitHeight + Appearance.padding.small + + StateLayer { + radius: Appearance.rounding.full + + function onClicked(): void { + QsWindow.window.destroy(); + } + } + + MaterialIcon { + id: closeIcon + + anchors.centerIn: parent + text: "close" + } + } +} |