1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-11 07:52:50 -05:00

Logic updates to re-ordering topbar widgets

This commit is contained in:
purian23
2025-08-01 23:14:19 -04:00
parent 12c62720b3
commit 8fb8281988
4 changed files with 94 additions and 111 deletions

View File

@@ -12,7 +12,7 @@ Column {
property string titleIcon: "widgets"
property string sectionId: ""
signal itemEnabledChanged(string itemId, bool enabled)
signal itemEnabledChanged(string sectionId, string itemId, bool enabled)
signal itemOrderChanged(var newOrder)
signal addWidget(string sectionId)
signal removeLastWidget(string sectionId)
@@ -142,7 +142,7 @@ Column {
hideText: true
checked: modelData.enabled
onToggled: (checked) => {
root.itemEnabledChanged(modelData.id, checked)
root.itemEnabledChanged(root.sectionId, modelData.id, checked)
}
}
@@ -183,7 +183,7 @@ Column {
var draggedItem = newItems.splice(index, 1)[0]
newItems.splice(newIndex, 0, draggedItem)
root.itemOrderChanged(newItems.map(item => item.id))
root.itemOrderChanged(newItems.map(item => ({id: item.id, enabled: item.enabled})))
}
}