Edit the notch's tiles in place instead of in the Control Center
The notch's cog now switches its middle column into edit mode (drag to move, corner to resize, badge to remove, chips to add), saving only to notch.controls. "Follow Control Center" clears it to mirror the Control Center again. The Control Center is back to editing only its own layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
efaace0f15
commit
de0295e18e
5 files changed
+346
-60
No files matched your search
@@ -55,10 +55,7 @@ PanelWindow {
|
||||
readonly property int cellHeight: 68
|
||||
readonly property real gridWidth: panel.targetWidth - 28
|
||||
readonly property real cellWidth: (gridWidth - 3 * gap) / Grid.COLS
|
||||
// The notch's cog edits the notch's own tile layout here.
|
||||
readonly property bool notchLayout: ShellState.controlCenterTarget === "notch"
|
||||
readonly property string layoutPath: notchLayout ? "notch.controls" : "controlCenter.modules"
|
||||
readonly property var entries: !ConfigService.ready ? [] : notchLayout ? ControlRegistry.notchModules : ConfigService.data.controlCenter.modules
|
||||
readonly property var entries: ConfigService.ready ? ConfigService.data.controlCenter.modules : []
|
||||
readonly property var tiles: entries.filter(m => m.enabled && !!ControlRegistry.entry(m.id) && !ControlRegistry.entry(m.id).section)
|
||||
readonly property bool notifications: entries.some(m => m.id === "notifications" && m.enabled)
|
||||
readonly property var addable: ControlRegistry.ids.filter(id => !entries.some(m => m.id === id && m.enabled))
|
||||
@@ -95,7 +92,7 @@ PanelWindow {
|
||||
// Writes every tile's cell (and changed sizes) back, so nothing repacks
|
||||
// and gaps stay.
|
||||
function save(plan, patch) {
|
||||
ConfigService.setValue(root.layoutPath, entries.map(m => {
|
||||
ConfigService.setValue("controlCenter.modules", entries.map(m => {
|
||||
const i = plan.items.find(t => t.id === m.id);
|
||||
let next = Object.assign({}, m);
|
||||
if (i) {
|
||||
@@ -143,21 +140,16 @@ PanelWindow {
|
||||
x: spot.col,
|
||||
y: spot.row
|
||||
} : {});
|
||||
ConfigService.setValue(root.layoutPath, known ? entries.map(m => m.id === id ? added : m) : entries.concat([added]));
|
||||
ConfigService.setValue("controlCenter.modules", known ? entries.map(m => m.id === id ? added : m) : entries.concat([added]));
|
||||
}
|
||||
function reset() {
|
||||
// The notch resets to following the Control Center again.
|
||||
ConfigService.setValue(root.layoutPath, notchLayout ? [] : ConfigService.defaults.controlCenter.modules);
|
||||
ConfigService.setValue("controlCenter.modules", ConfigService.defaults.controlCenter.modules);
|
||||
}
|
||||
Connections {
|
||||
target: ShellState
|
||||
function onControlCenterOpenChanged() {
|
||||
if (!ShellState.controlCenterOpen)
|
||||
root.editing = false;
|
||||
else if (ShellState.controlCenterEditRequested) {
|
||||
ShellState.controlCenterEditRequested = false;
|
||||
root.editing = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,7 +305,7 @@ PanelWindow {
|
||||
Layout.leftMargin: 4
|
||||
spacing: 2
|
||||
Text {
|
||||
text: root.notchLayout ? (root.editing ? "Edit Notch Controls" : "Notch Controls") : root.editing ? "Edit Controls" : "Control Center"
|
||||
text: root.editing ? "Edit Controls" : "Control Center"
|
||||
color: Theme.text
|
||||
font.pixelSize: 14
|
||||
font.weight: Font.DemiBold
|
||||
|
||||
Reference in new issue
Block a user