Lay the Control Center out as a resizable, editable grid

Modules are tiles on a 4-column grid, each 1x1 to 4x4 and adapting its
layout to its size. Edit Controls in the panel reorders by dragging,
resizes from a corner handle, removes with a badge and adds from a tray.
Connectivity splits into Wi-Fi, Bluetooth and Network tiles and Audio
into Sound and Microphone; right-clicking Sound extends it with output
devices and a volume slider per app. Adds a Caffeine tile. Config
version 2 migrates existing layouts in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-10-17 20:52:14 +02:00
1 parent 0dcf37346c
commit 11bdc4c751
32 files changed
+2147 -355

No files matched your search

+49 -1
View File
@@ -35,6 +35,19 @@ Item {
property bool muted: false
}
}
property var streamNode: QtObject {
property string name: "fixture-player"
property string description: ""
property bool isSink: false
property bool isStream: true
property var properties: ({
"application.name": "Fixture player"
})
property QtObject audio: QtObject {
property real volume: 0.5
property bool muted: false
}
}
property QtObject audioBackend: QtObject {
property bool ready: true
property var defaultAudioSink: root.audioNode
@@ -42,7 +55,7 @@ Item {
property var preferredDefaultAudioSink: root.audioNode
property var preferredDefaultAudioSource: root.audioInput
property QtObject nodes: QtObject {
property var values: [root.audioNode, root.audioInput]
property var values: [root.audioNode, root.audioInput, root.streamNode]
}
}
property QtObject wifi: QtObject {
@@ -139,6 +152,7 @@ Item {
NetworkService.backend = root.networkBackend;
BluetoothService.backend = root.btBackend;
SystemService.helper = "testing/recording_system.py";
CaffeineService.command = ["sleep", "infinity"];
SystemService.refresh();
return true;
}
@@ -158,6 +172,32 @@ Item {
input.mouseClick(item, item.width * .75, item.height / 2);
return true;
}
function rightClick(name: string): bool {
const item = root.child(name);
if (!item || !item.enabled)
return false;
root.reveal(item);
// Near the corner: clear of sliders and buttons on every layout.
input.mouseClick(item, 14, 14, Qt.RightButton);
return true;
}
// Presses an item and drags it by (dx, dy) in steps.
function drag(name: string, dx: real, dy: real): bool {
const item = root.child(name);
if (!item || !item.visible)
return false;
root.reveal(item);
// Window coordinates, like a real pointer: the item may move or grow.
const content = ShellState.controlCenterWindow.contentItem;
const p = item.mapToItem(content, item.width / 2, item.height / 2);
input.mousePress(content, p.x, p.y);
for (let i = 1; i <= 8; ++i)
input.mouseMove(content, p.x + dx * i / 8, p.y + dy * i / 8, 20);
input.wait(60);
input.mouseRelease(content, p.x + dx, p.y + dy);
input.wait(60);
return true;
}
function clickSystem(): bool {
const pill = ShellState.systemPills.find(p => p.barScreen === ScreenService.active) || ShellState.systemPills[0];
if (!pill)
@@ -226,6 +266,14 @@ Item {
muted: AudioService.sink && AudioService.sink.audio ? AudioService.sink.audio.muted : false,
microphone: AudioService.source && AudioService.source.audio ? AudioService.source.audio.muted : false,
scan: fixtureWifi.scannerEnabled,
editing: ShellState.controlCenterWindow.editing,
tiles: ShellState.controlCenterWindow.plan.items,
cellWidth: ShellState.controlCenterWindow.cellWidth,
extras: ShellState.controlCenterWindow.extras,
streamVolume: root.streamNode.audio.volume,
streamMuted: root.streamNode.audio.muted,
caffeine: CaffeineService.active,
caffeineRunning: CaffeineService.running,
active: ScreenService.active.name,
screens: Quickshell.screens.map(s => s.name),
x: ShellState.controlCenterWindow.panelScreenX,