Files
glassMxrph/quickshell/settings/pages/ControlCenter.qml
T
mxandClaude Opus 5.5 99e64a7713 Add glassMxrph shell sources
Initial commit of the Quickshell desktop suite: bar, dock, launcher,
settings, Control Center, dashboard, OSD, lock screen, desktop widgets,
plugin host with the vendored Noctalia/Omarchy compatibility layer,
helpers, packaging, tests and phase documentation.

Includes the optimization work so far: usage widgets and dashboard
gauges no longer animate continuously, desktop widgets pause while
covered, system controls stop flickering on background polls, dock app
matching uses an indexed catalog, and workspace ghosts are created only
for occupied slots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 22:36:17 +02:00

92 lines
3.3 KiB
QML

pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import "../controls"
import "../../controlcenter"
import "../../components"
import "../../services"
SettingsPage {
id: root
function edit(index, enabled) {
const list = ConfigService.data.controlCenter.modules.map(m => Object.assign({}, m));
list[index].enabled = enabled;
ConfigService.setValue("controlCenter.modules", list);
}
function move(index, step) {
const list = ConfigService.data.controlCenter.modules.slice();
const to = index + step;
if (to < 0 || to >= list.length)
return;
const entry = list.splice(index, 1)[0];
list.splice(to, 0, entry);
ConfigService.setValue("controlCenter.modules", list);
}
SettingsSection {
title: "Panel"
PreferenceSlider {
label: "Panel width"
icon: "󰹑"
setting: "controlCenter.width"
from: 320
to: 600
step: 10
unit: " px"
}
}
SettingsSection {
title: "Modules"
description: "Enable, disable and order the Control Center cards"
Repeater {
model: ConfigService.data.controlCenter.modules
SettingRow {
id: card
required property var modelData
required property int index
readonly property var entry: ControlRegistry.entry(modelData.id)
title: entry ? entry.title : modelData.id + " (unavailable)"
GlassIconButton {
objectName: "control-up-" + card.modelData.id
text: "↑"
enabled: card.index > 0
onClicked: root.move(card.index, -1)
}
GlassIconButton {
objectName: "control-down-" + card.modelData.id
text: "↓"
enabled: card.index < ConfigService.data.controlCenter.modules.length - 1
onClicked: root.move(card.index, 1)
}
GlassToggle {
objectName: "control-enable-" + card.modelData.id
checked: card.modelData.enabled
onClicked: root.edit(card.index, checked)
}
}
}
Flow {
Layout.fillWidth: true
Layout.margins: 8
spacing: 8
visible: addRepeater.count > 0
Repeater {
id: addRepeater
model: Object.keys(ControlRegistry.modules).filter(id => !ConfigService.data.controlCenter.modules.some(m => m.id === id))
GlassButton {
required property string modelData
text: "+ " + ControlRegistry.modules[modelData].title
onClicked: ConfigService.setValue("controlCenter.modules", ConfigService.data.controlCenter.modules.concat([
{
id: modelData,
enabled: true
}
]))
}
}
}
}
SettingNote {
text: "Super+X can use the documented IPC binding. Existing keybinds are unchanged."
}
}