feat: add initial nexus
This commit is contained in:
parent
dd8cf886ad
commit
5f4fb88624
6 changed files with 278 additions and 5 deletions
|
|
@ -4,7 +4,7 @@ import Quickshell.Io
|
||||||
import Caelestia
|
import Caelestia
|
||||||
import qs.components.misc
|
import qs.components.misc
|
||||||
import qs.services
|
import qs.services
|
||||||
import qs.modules.controlcenter
|
import qs.modules.nexus
|
||||||
|
|
||||||
Scope {
|
Scope {
|
||||||
id: root
|
id: root
|
||||||
|
|
@ -15,8 +15,8 @@ Scope {
|
||||||
// qmllint disable unresolved-type
|
// qmllint disable unresolved-type
|
||||||
CustomShortcut {
|
CustomShortcut {
|
||||||
// qmllint enable unresolved-type
|
// qmllint enable unresolved-type
|
||||||
name: "controlCenter"
|
name: "nexus"
|
||||||
description: "Open control center"
|
description: "Open nexus"
|
||||||
onPressed: WindowFactory.create()
|
onPressed: WindowFactory.create()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -133,7 +133,7 @@ Scope {
|
||||||
WindowFactory.create();
|
WindowFactory.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
target: "controlCenter"
|
target: "nexus"
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcHandler {
|
IpcHandler {
|
||||||
|
|
|
||||||
80
modules/nexus/Nexus.qml
Normal file
80
modules/nexus/Nexus.qml
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
12
modules/nexus/NexusState.qml
Normal file
12
modules/nexus/NexusState.qml
Normal 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
|
||||||
|
}
|
||||||
111
modules/nexus/PageRegistry.qml
Normal file
111
modules/nexus/PageRegistry.qml
Normal 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")
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
56
modules/nexus/WindowFactory.qml
Normal file
56
modules/nexus/WindowFactory.qml
Normal 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 {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -323,6 +323,18 @@ public:
|
||||||
: ConfigObject(parent) {}
|
: 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 {
|
class SizeTokens : public ConfigObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
QML_ANONYMOUS
|
QML_ANONYMOUS
|
||||||
|
|
@ -338,6 +350,7 @@ class SizeTokens : public ConfigObject {
|
||||||
CONFIG_SUBOBJECT(LockTokens, lock)
|
CONFIG_SUBOBJECT(LockTokens, lock)
|
||||||
CONFIG_SUBOBJECT(WInfoTokens, winfo)
|
CONFIG_SUBOBJECT(WInfoTokens, winfo)
|
||||||
CONFIG_SUBOBJECT(ControlCenterTokens, controlCenter)
|
CONFIG_SUBOBJECT(ControlCenterTokens, controlCenter)
|
||||||
|
CONFIG_SUBOBJECT(NexusTokens, nexus)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SizeTokens(QObject* parent = nullptr)
|
explicit SizeTokens(QObject* parent = nullptr)
|
||||||
|
|
@ -352,7 +365,8 @@ public:
|
||||||
, m_utilities(new UtilitiesTokens(this))
|
, m_utilities(new UtilitiesTokens(this))
|
||||||
, m_lock(new LockTokens(this))
|
, m_lock(new LockTokens(this))
|
||||||
, m_winfo(new WInfoTokens(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 {
|
class TokenConfig : public RootConfig {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue