Merge remote-tracking branch 'upstream/main' into notifications-refine

Resolve conflicts due to project structure changes
This commit is contained in:
FUFSoB
2025-09-24 07:40:50 +05:00
92 changed files with 1872 additions and 1670 deletions
+22 -10
View File
@@ -53,7 +53,8 @@ Singleton {
// This should only be activated once when the settings structure has changed
// Then it should be commented out again, regular users don't need to generate
// default settings on every start
//generateDefaultSettings()
// TODO: automate this someday!
// generateDefaultSettings()
// Patch-in the local default, resolved to user's home
adapter.general.avatarImage = defaultAvatar
@@ -113,7 +114,7 @@ Singleton {
JsonAdapter {
id: adapter
property int settingsVersion: 4
property int settingsVersion: 5
// bar
property JsonObject bar: JsonObject {
@@ -142,7 +143,7 @@ Singleton {
"id": "Workspace"
}]
property list<var> right: [{
"id": "ScreenRecorderIndicator"
"id": "ScreenRecorder"
}, {
"id": "Tray"
}, {
@@ -162,7 +163,7 @@ Singleton {
}, {
"id": "Clock"
}, {
"id": "SidePanelToggle"
"id": "ControlCenter"
}]
}
}
@@ -254,6 +255,7 @@ Singleton {
property int lowUrgencyDuration: 3
property int normalUrgencyDuration: 8
property int criticalUrgencyDuration: 15
property bool enableOSD: true
}
// audio
@@ -381,15 +383,25 @@ Singleton {
const sections = ["left", "center", "right"]
// -----------------
// 1st. check our settings are not super old, when we only had the widget type as a plain string
// 1st. convert old widget id to new id
for (var s = 0; s < sections.length; s++) {
const sectionName = sections[s]
for (var i = 0; i < adapter.bar.widgets[sectionName].length; i++) {
var widget = adapter.bar.widgets[sectionName][i]
if (typeof widget === "string") {
adapter.bar.widgets[sectionName][i] = {
"id": widget
}
switch (widget.id) {
case "DarkModeToggle":
widget.id = "DarkMode"
break
case "PowerToggle":
widget.id = "SessionMenu"
break
case "ScreenRecorderIndicator":
widget.id = "ScreenRecorder"
break
case "SidePanelToggle":
widget.id = "ControlCenter"
break
}
}
}
@@ -403,8 +415,8 @@ Singleton {
for (var i = widgets.length - 1; i >= 0; i--) {
var widget = widgets[i]
if (!BarWidgetRegistry.hasWidget(widget.id)) {
widgets.splice(i, 1)
Logger.warn(`Settings`, `Deleted invalid widget ${widget.id}`)
widgets.splice(i, 1)
}
}
}