From d9ffc13825b56cb97bce4d31fca4abbdc42b0985 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Thu, 7 Aug 2025 15:38:17 +1000 Subject: controlcenter: add floating mode Closes #363 --- modules/controlcenter/WindowFactory.qml | 62 +++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 modules/controlcenter/WindowFactory.qml (limited to 'modules/controlcenter/WindowFactory.qml') diff --git a/modules/controlcenter/WindowFactory.qml b/modules/controlcenter/WindowFactory.qml new file mode 100644 index 0000000..75550c3 --- /dev/null +++ b/modules/controlcenter/WindowFactory.qml @@ -0,0 +1,62 @@ +pragma Singleton + +import qs.services +import qs.config +import Quickshell +import QtQuick + +Singleton { + id: root + + function create(parent: Item, props: var): void { + controlCenter.createObject(parent ?? dummy, props); + } + + QtObject { + id: dummy + } + + Component { + id: controlCenter + + FloatingWindow { + id: win + + property alias active: cc.active + property alias navExpanded: cc.navExpanded + + color: Colours.palette.m3surface + + onVisibleChanged: { + if (!visible) + destroy(); + } + + minimumSize.width: 1000 + minimumSize.height: 600 + + implicitWidth: cc.implicitWidth + implicitHeight: cc.implicitHeight + + ControlCenter { + id: cc + + anchors.fill: parent + screen: win.screen + floating: true + + function close(): void { + win.visible = false; + } + } + + Behavior on color { + ColorAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard + } + } + } + } +} -- cgit v1.2.3-freya