feat: add initial nexus

This commit is contained in:
2 * r + 2 * t 2026-06-03 01:23:25 +10:00
parent dd8cf886ad
commit 5f4fb88624
6 changed files with 278 additions and 5 deletions

View file

@ -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 {

80
modules/nexus/Nexus.qml Normal file
View file

@ -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
}
}

View file

@ -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
}

View file

@ -0,0 +1,111 @@
pragma Singleton
import QtQuick
QtObject {
id: root
readonly property list<var> 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")
}
]
}

View file

@ -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 {}
}
}
}
}

View file

@ -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 {