From 5f4fb886242ca779ac51cc37eb173ac379dffb06 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 3 Jun 2026 01:23:25 +1000 Subject: [PATCH] feat: add initial nexus --- modules/Shortcuts.qml | 8 +- modules/nexus/Nexus.qml | 80 ++++++++++++++++++ modules/nexus/NexusState.qml | 12 +++ modules/nexus/PageRegistry.qml | 111 +++++++++++++++++++++++++ modules/nexus/WindowFactory.qml | 56 +++++++++++++ plugin/src/Caelestia/Config/tokens.hpp | 16 +++- 6 files changed, 278 insertions(+), 5 deletions(-) create mode 100644 modules/nexus/Nexus.qml create mode 100644 modules/nexus/NexusState.qml create mode 100644 modules/nexus/PageRegistry.qml create mode 100644 modules/nexus/WindowFactory.qml diff --git a/modules/Shortcuts.qml b/modules/Shortcuts.qml index 9ee79676..f49fa0e0 100644 --- a/modules/Shortcuts.qml +++ b/modules/Shortcuts.qml @@ -4,7 +4,7 @@ import Quickshell.Io import Caelestia import qs.components.misc import qs.services -import qs.modules.controlcenter +import qs.modules.nexus Scope { id: root @@ -15,8 +15,8 @@ Scope { // qmllint disable unresolved-type CustomShortcut { // qmllint enable unresolved-type - name: "controlCenter" - description: "Open control center" + name: "nexus" + description: "Open nexus" onPressed: WindowFactory.create() } @@ -133,7 +133,7 @@ Scope { WindowFactory.create(); } - target: "controlCenter" + target: "nexus" } IpcHandler { diff --git a/modules/nexus/Nexus.qml b/modules/nexus/Nexus.qml new file mode 100644 index 00000000..5ffec404 --- /dev/null +++ b/modules/nexus/Nexus.qml @@ -0,0 +1,80 @@ +pragma ComponentBehavior: Bound + +import QtQuick +import Caelestia.Blobs +import Caelestia.Config +import qs.components +import qs.components.controls +import qs.services + +Item { + id: root + + readonly property NexusState nState: NexusState { + id: nState + + onClose: root.close() + } + + signal close + + implicitWidth: implicitHeight * Tokens.sizes.nexus.ratio + implicitHeight: nState.screen.height * Tokens.sizes.nexus.heightMult + + BlobGroup { + id: blobGroup + + smoothing: root.Tokens.rounding.largeIncreased + color: Colours.palette.m3surfaceContainer + } + + BlobInvertedRect { + anchors.fill: parent + group: blobGroup + radius: Tokens.rounding.large + + borderLeft: navPane.implicitWidth + Tokens.padding.medium + borderRight: Tokens.padding.medium + borderTop: Tokens.padding.medium + borderBottom: Tokens.padding.medium + } + + BlobRect { + anchors.right: parent.right + anchors.top: parent.top + + group: blobGroup + radius: Tokens.rounding.medium + + implicitWidth: windowBtn.implicitWidth + Tokens.padding.small * 2 + implicitHeight: windowBtn.implicitHeight + Tokens.padding.extraSmall * 2 + + IconButton { + id: windowBtn + + anchors.centerIn: parent + icon: nState.isWindow ? "close" : "pip" + type: IconButton.Text + label.fill: 0 + inactiveOnColour: hovered ? nState.isWindow ? Colours.palette.m3error : Colours.palette.m3primary : Colours.palette.m3onSurfaceVariant + stateLayer.opacity: 0 + onClicked: { + if (!nState.isWindow); // TODO: open floating window via factory + root.close(); + } + + label.scale: pressed ? 0.8 : 1 + label.renderType: Text.QtRendering + + Behavior on label.scale { + Anim {} + } + } + } + + Item { + id: navPane // TODO + + implicitWidth: 400 + } +} diff --git a/modules/nexus/NexusState.qml b/modules/nexus/NexusState.qml new file mode 100644 index 00000000..95ad6e47 --- /dev/null +++ b/modules/nexus/NexusState.qml @@ -0,0 +1,12 @@ +import QtQuick +import Quickshell + +QtObject { + property ShellScreen screen + property bool isWindow + property bool navExpanded + property string currentPageName + property int currentPageIdx + + signal close +} diff --git a/modules/nexus/PageRegistry.qml b/modules/nexus/PageRegistry.qml new file mode 100644 index 00000000..73955208 --- /dev/null +++ b/modules/nexus/PageRegistry.qml @@ -0,0 +1,111 @@ +pragma Singleton + +import QtQuick + +QtObject { + id: root + + readonly property list pages: [ + { + label: qsTr("Appearance"), + icon: "palette", + description: qsTr("Customise the look and feel of your desktop") + }, + { + label: qsTr("Taskbar"), + icon: "dock_to_bottom", + description: qsTr("Configure your taskbar appearance and behavior") + }, + { + label: qsTr("Launcher"), + icon: "apps", + description: qsTr("Customize application launcher settings") + }, + { + label: qsTr("Dashboard"), + icon: "dashboard", + description: qsTr("Configure dashboard widgets and layout") + }, + { + label: qsTr("Sidebar"), + icon: "side_navigation", + description: qsTr("Sidebar panel settings") + }, + { + label: qsTr("Utilities"), + icon: "handyman", + description: qsTr("Quick access utilities and tools") + }, + { + label: qsTr("Notifications"), + icon: "notifications", + description: qsTr("Manage notification settings and behavior") + }, + { + label: qsTr("Session"), + icon: "account_circle", + description: qsTr("User session and power menu settings") + }, + { + label: qsTr("Lockscreen"), + icon: "lock", + description: qsTr("Lock screen appearance and security") + }, + { + label: qsTr("Display"), + icon: "monitor", + title: "Display", + description: qsTr("Monitor configuration and display settings") + }, + { + label: qsTr("Network"), + icon: "wifi", + description: qsTr("Network connections and settings") + }, + { + label: qsTr("Audio"), + icon: "volume_up", + description: qsTr("Sound devices and volume control") + }, + { + label: qsTr("Bluetooth"), + icon: "bluetooth", + description: qsTr("Bluetooth device management") + }, + { + label: qsTr("Location"), + icon: "location_on", + description: qsTr("Location access and privacy") + }, + { + label: qsTr("Screen recorder"), + icon: "screen_record", + description: qsTr("Screen recording settings") + }, + { + label: qsTr("Power"), + icon: "power_settings_new", + description: qsTr("Power management and battery settings") + }, + { + label: qsTr("Plugins"), + icon: "extension", + description: qsTr("Manage and configure plugins") + }, + { + label: qsTr("Hooks"), + icon: "link", + description: qsTr("System hooks and automation") + }, + { + label: qsTr("About"), + icon: "info", + description: qsTr("System information and credits") + }, + { + label: qsTr("Updates"), + icon: "update", + description: qsTr("System updates and changelog") + } + ] +} diff --git a/modules/nexus/WindowFactory.qml b/modules/nexus/WindowFactory.qml new file mode 100644 index 00000000..a2c82459 --- /dev/null +++ b/modules/nexus/WindowFactory.qml @@ -0,0 +1,56 @@ +pragma Singleton + +import QtQuick +import Quickshell +import qs.components +import qs.services + +Singleton { + id: root + + function create(parent: Item, props: var): void { + nexusComp.createObject(parent ?? dummy, props); + } + + QtObject { + id: dummy + } + + Component { + id: nexusComp + + FloatingWindow { + id: win + + color: Colours.tPalette.m3surface + + onVisibleChanged: { + if (!visible) + destroy(); + } + + implicitWidth: nexus.implicitWidth + implicitHeight: nexus.implicitHeight + + minimumSize.width: implicitWidth + minimumSize.height: implicitHeight + maximumSize.width: implicitWidth + maximumSize.height: implicitHeight + + title: qsTr("Nexus — %1").arg(nexus.nState.currentPageName) + + Nexus { + id: nexus + + anchors.fill: parent + nState.screen: win.screen + nState.isWindow: true + onClose: win.destroy() + } + + Behavior on color { + CAnim {} + } + } + } +} diff --git a/plugin/src/Caelestia/Config/tokens.hpp b/plugin/src/Caelestia/Config/tokens.hpp index d29f62ee..ef4c51a2 100644 --- a/plugin/src/Caelestia/Config/tokens.hpp +++ b/plugin/src/Caelestia/Config/tokens.hpp @@ -323,6 +323,18 @@ public: : ConfigObject(parent) {} }; +class NexusTokens : public ConfigObject { + Q_OBJECT + QML_ANONYMOUS + + CONFIG_PROPERTY(qreal, heightMult, 0.7) + CONFIG_PROPERTY(qreal, ratio, 16.0 / 9.0) + +public: + explicit NexusTokens(QObject* parent = nullptr) + : ConfigObject(parent) {} +}; + class SizeTokens : public ConfigObject { Q_OBJECT QML_ANONYMOUS @@ -338,6 +350,7 @@ class SizeTokens : public ConfigObject { CONFIG_SUBOBJECT(LockTokens, lock) CONFIG_SUBOBJECT(WInfoTokens, winfo) CONFIG_SUBOBJECT(ControlCenterTokens, controlCenter) + CONFIG_SUBOBJECT(NexusTokens, nexus) public: explicit SizeTokens(QObject* parent = nullptr) @@ -352,7 +365,8 @@ public: , m_utilities(new UtilitiesTokens(this)) , m_lock(new LockTokens(this)) , m_winfo(new WInfoTokens(this)) - , m_controlCenter(new ControlCenterTokens(this)) {} + , m_controlCenter(new ControlCenterTokens(this)) + , m_nexus(new NexusTokens(this)) {} }; class TokenConfig : public RootConfig {