mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
cc: fix settings usage
This commit is contained in:
@@ -21,7 +21,7 @@ function addWidget(widgetId) {
|
||||
}
|
||||
|
||||
widgets.push(widget)
|
||||
SettingsData.setControlCenterWidgets(widgets)
|
||||
SettingsData.set("controlCenterWidgets", widgets)
|
||||
}
|
||||
|
||||
function generateUniqueId() {
|
||||
@@ -32,7 +32,7 @@ function removeWidget(index) {
|
||||
var widgets = SettingsData.controlCenterWidgets.slice()
|
||||
if (index >= 0 && index < widgets.length) {
|
||||
widgets.splice(index, 1)
|
||||
SettingsData.setControlCenterWidgets(widgets)
|
||||
SettingsData.set("controlCenterWidgets", widgets)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,12 +54,12 @@ function toggleWidgetSize(index) {
|
||||
}
|
||||
}
|
||||
|
||||
SettingsData.setControlCenterWidgets(widgets)
|
||||
SettingsData.set("controlCenterWidgets", widgets)
|
||||
}
|
||||
}
|
||||
|
||||
function reorderWidgets(newOrder) {
|
||||
SettingsData.setControlCenterWidgets(newOrder)
|
||||
SettingsData.set("controlCenterWidgets", newOrder)
|
||||
}
|
||||
|
||||
function moveWidget(fromIndex, toIndex) {
|
||||
@@ -67,7 +67,7 @@ function moveWidget(fromIndex, toIndex) {
|
||||
if (fromIndex >= 0 && fromIndex < widgets.length && toIndex >= 0 && toIndex < widgets.length) {
|
||||
const movedWidget = widgets.splice(fromIndex, 1)[0]
|
||||
widgets.splice(toIndex, 0, movedWidget)
|
||||
SettingsData.setControlCenterWidgets(widgets)
|
||||
SettingsData.set("controlCenterWidgets", widgets)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,9 +82,9 @@ function resetToDefault() {
|
||||
{"id": "nightMode", "enabled": true, "width": 50},
|
||||
{"id": "darkMode", "enabled": true, "width": 50}
|
||||
]
|
||||
SettingsData.setControlCenterWidgets(defaultWidgets)
|
||||
SettingsData.set("controlCenterWidgets", defaultWidgets)
|
||||
}
|
||||
|
||||
function clearAll() {
|
||||
SettingsData.setControlCenterWidgets([])
|
||||
SettingsData.set("controlCenterWidgets", [])
|
||||
}
|
||||
Reference in New Issue
Block a user