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:
1 parent
0dcf37346c
commit
11bdc4c751
32 files changed
+2147
-355
No files matched your search
@@ -2,46 +2,122 @@ pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
|
||||
// Control Center modules. Grid tiles have a default size in cells (w × h,
|
||||
// each 1–4) that the user can change in edit mode; Notifications is a section
|
||||
// under the grid instead.
|
||||
Singleton {
|
||||
function entry(id) {
|
||||
return Object.prototype.hasOwnProperty.call(modules, id) ? modules[id] : null;
|
||||
}
|
||||
// Configured size, else the module's default.
|
||||
function size(module) {
|
||||
if (!module)
|
||||
return {
|
||||
w: 1,
|
||||
h: 1
|
||||
};
|
||||
const e = entry(module.id);
|
||||
return {
|
||||
w: module.w || (e ? e.w : 1),
|
||||
h: module.h || (e ? e.h : 1)
|
||||
};
|
||||
}
|
||||
readonly property var modules: ({
|
||||
metrics: {title:"System Metrics", source:Qt.resolvedUrl("modules/Metrics.qml")},
|
||||
connectivity: {
|
||||
title: "Connectivity",
|
||||
source: Qt.resolvedUrl("modules/Connectivity.qml")
|
||||
wifi: {
|
||||
title: "Wi-Fi",
|
||||
glyph: "",
|
||||
w: 2,
|
||||
h: 1,
|
||||
source: Qt.resolvedUrl("modules/Wifi.qml")
|
||||
},
|
||||
audio: {
|
||||
title: "Audio",
|
||||
source: Qt.resolvedUrl("modules/Audio.qml")
|
||||
bluetooth: {
|
||||
title: "Bluetooth",
|
||||
glyph: "",
|
||||
w: 1,
|
||||
h: 1,
|
||||
source: Qt.resolvedUrl("modules/Bluetooth.qml")
|
||||
},
|
||||
network: {
|
||||
title: "Network",
|
||||
glyph: "",
|
||||
w: 2,
|
||||
h: 1,
|
||||
source: Qt.resolvedUrl("modules/Network.qml")
|
||||
},
|
||||
output: {
|
||||
title: "Sound",
|
||||
glyph: "",
|
||||
w: 4,
|
||||
h: 1,
|
||||
source: Qt.resolvedUrl("modules/Output.qml")
|
||||
},
|
||||
input: {
|
||||
title: "Microphone",
|
||||
glyph: "",
|
||||
w: 4,
|
||||
h: 1,
|
||||
source: Qt.resolvedUrl("modules/Input.qml")
|
||||
},
|
||||
brightness: {
|
||||
title: "Brightness",
|
||||
title: "Display",
|
||||
glyph: "",
|
||||
w: 4,
|
||||
h: 1,
|
||||
source: Qt.resolvedUrl("modules/Brightness.qml")
|
||||
},
|
||||
nightLight: {
|
||||
title: "Night Light",
|
||||
glyph: "",
|
||||
w: 1,
|
||||
h: 1,
|
||||
source: Qt.resolvedUrl("modules/NightLight.qml")
|
||||
},
|
||||
dnd: {
|
||||
title: "Do Not Disturb",
|
||||
glyph: "",
|
||||
w: 1,
|
||||
h: 1,
|
||||
source: Qt.resolvedUrl("modules/Dnd.qml")
|
||||
},
|
||||
caffeine: {
|
||||
title: "Caffeine",
|
||||
glyph: "",
|
||||
w: 1,
|
||||
h: 1,
|
||||
source: Qt.resolvedUrl("modules/Caffeine.qml")
|
||||
},
|
||||
profiles: {
|
||||
title: "Power profile",
|
||||
glyph: "",
|
||||
w: 2,
|
||||
h: 1,
|
||||
source: Qt.resolvedUrl("modules/Profiles.qml")
|
||||
},
|
||||
media: {
|
||||
title: "Media",
|
||||
source: Qt.resolvedUrl("modules/Media.qml")
|
||||
title: "Now Playing",
|
||||
glyph: "",
|
||||
w: 2,
|
||||
h: 2,
|
||||
source: Qt.resolvedUrl("modules/NowPlaying.qml")
|
||||
},
|
||||
power: {
|
||||
title: "Power",
|
||||
glyph: "",
|
||||
w: 4,
|
||||
h: 1,
|
||||
source: Qt.resolvedUrl("modules/Power.qml")
|
||||
},
|
||||
metrics: {
|
||||
title: "System Metrics",
|
||||
glyph: "",
|
||||
w: 4,
|
||||
h: 1,
|
||||
source: Qt.resolvedUrl("modules/Metrics.qml")
|
||||
},
|
||||
notifications: {
|
||||
title: "Notifications",
|
||||
glyph: "",
|
||||
section: true,
|
||||
source: Qt.resolvedUrl("modules/Notifications.qml")
|
||||
}
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user