summaryrefslogtreecommitdiff
path: root/modules/controlcenter/WindowFactory.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-07 15:38:17 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-07 15:38:17 +1000
commitd9ffc13825b56cb97bce4d31fca4abbdc42b0985 (patch)
treeeb506d597bf47e9884e959b069c446673eee312e /modules/controlcenter/WindowFactory.qml
parentdashboard: showOnHover config option (#361) (diff)
downloadcaelestia-shell-d9ffc13825b56cb97bce4d31fca4abbdc42b0985.tar.gz
caelestia-shell-d9ffc13825b56cb97bce4d31fca4abbdc42b0985.tar.bz2
caelestia-shell-d9ffc13825b56cb97bce4d31fca4abbdc42b0985.zip
controlcenter: add floating mode
Closes #363
Diffstat (limited to 'modules/controlcenter/WindowFactory.qml')
-rw-r--r--modules/controlcenter/WindowFactory.qml62
1 files changed, 62 insertions, 0 deletions
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
+ }
+ }
+ }
+ }
+}