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