1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-25 05:52:50 -05:00

Add disk usage component for TopBar and ControlCenter

This commit is contained in:
bbedward
2025-09-24 18:06:46 -04:00
parent 9be7d44765
commit b893694977
14 changed files with 676 additions and 12 deletions

View File

@@ -32,7 +32,7 @@ function calculateRowsAndWidgets(controlCenterColumn, expandedSection, expandedW
currentWidth += (currentRow.length > 1 ? spacing : 0) + itemWidth
}
if (widget.id === expandedSection && expandedWidgetIndex === i) {
if (expandedWidgetIndex === i) {
expandedRow = rows.length
}
}

View File

@@ -9,10 +9,20 @@ function addWidget(widgetId) {
"enabled": true,
"width": 50
}
if (widgetId === "diskUsage") {
widget.instanceId = generateUniqueId()
widget.mountPath = "/"
}
widgets.push(widget)
SettingsData.setControlCenterWidgets(widgets)
}
function generateUniqueId() {
return Date.now().toString(36) + Math.random().toString(36).substr(2)
}
function removeWidget(index) {
var widgets = SettingsData.controlCenterWidgets.slice()
if (index >= 0 && index < widgets.length) {