Fix modular bar (remove option)

This commit is contained in:
Ly-sec 2025-08-23 16:03:23 +02:00
parent e04c4e1394
commit b85d68f4cb
2 changed files with 26 additions and 0 deletions

View file

@ -218,6 +218,8 @@ ColumnLayout {
function removeWidgetFromSection(section, index) {
console.log("Removing widget from section", section, "at index", index)
var sectionArray = Settings.data.bar.widgets[section]
console.log("Current section array:", JSON.stringify(sectionArray))
if (sectionArray && index >= 0 && index < sectionArray.length) {
// Create a new array to avoid modifying the original
var newArray = sectionArray.slice()
@ -226,6 +228,17 @@ ColumnLayout {
// Assign the new array
Settings.data.bar.widgets[section] = newArray
// Force a settings save
console.log("Settings updated, triggering save...")
// Verify the change was applied
Qt.setTimeout(function() {
var updatedArray = Settings.data.bar.widgets[section]
console.log("Verification - updated section array:", JSON.stringify(updatedArray))
}, 100)
} else {
console.log("Invalid section or index:", section, index, "array length:", sectionArray ? sectionArray.length : "null")
}
}