mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-11 00:02:28 -04:00
feat: add more disk usage viewing options (#1833)
* feat: show memory widget in gb * cleanup * even more cleanup * fix * feat: add more disk usage viewing options
This commit is contained in:
@@ -398,8 +398,10 @@ Item {
|
||||
widgetObj.runningAppsCurrentWorkspace = SettingsData.runningAppsCurrentWorkspace;
|
||||
widgetObj.runningAppsCurrentMonitor = false;
|
||||
}
|
||||
if (widgetId === "diskUsage")
|
||||
if (widgetId === "diskUsage") {
|
||||
widgetObj.mountPath = "/";
|
||||
widgetObj.diskUsageMode = 0;
|
||||
}
|
||||
if (widgetId === "cpuUsage" || widgetId === "memUsage" || widgetId === "cpuTemp" || widgetId === "gpuTemp")
|
||||
widgetObj.minimumWidth = true;
|
||||
if (widgetId === "memUsage")
|
||||
@@ -427,7 +429,7 @@ Item {
|
||||
"id": widget.id,
|
||||
"enabled": widget.enabled
|
||||
};
|
||||
var keys = ["size", "selectedGpuIndex", "pciId", "mountPath", "minimumWidth", "showSwap", "showInGb", "mediaSize", "clockCompactMode", "focusedWindowCompactMode", "runningAppsCompactMode", "keyboardLayoutNameCompactMode", "runningAppsGroupByApp", "runningAppsCurrentWorkspace", "runningAppsCurrentMonitor", "showNetworkIcon", "showBluetoothIcon", "showAudioIcon", "showAudioPercent", "showVpnIcon", "showBrightnessIcon", "showBrightnessPercent", "showMicIcon", "showMicPercent", "showBatteryIcon", "showPrinterIcon", "showScreenSharingIcon", "barMaxVisibleApps", "barMaxVisibleRunningApps", "barShowOverflowBadge"];
|
||||
var keys = ["size", "selectedGpuIndex", "pciId", "mountPath", "diskUsageMode", "minimumWidth", "showSwap", "showInGb", "mediaSize", "clockCompactMode", "focusedWindowCompactMode", "runningAppsCompactMode", "keyboardLayoutNameCompactMode", "runningAppsGroupByApp", "runningAppsCurrentWorkspace", "runningAppsCurrentMonitor", "showNetworkIcon", "showBluetoothIcon", "showAudioIcon", "showAudioPercent", "showVpnIcon", "showBrightnessIcon", "showBrightnessPercent", "showMicIcon", "showMicPercent", "showBatteryIcon", "showPrinterIcon", "showScreenSharingIcon", "barMaxVisibleApps", "barMaxVisibleRunningApps", "barShowOverflowBadge"];
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
if (widget[keys[i]] !== undefined)
|
||||
result[keys[i]] = widget[keys[i]];
|
||||
@@ -550,6 +552,18 @@ Item {
|
||||
setWidgetsForSection(sectionId, widgets);
|
||||
}
|
||||
|
||||
function handleDiskUsageModeChanged(sectionId, widgetIndex, mode) {
|
||||
var widgets = getWidgetsForSection(sectionId).slice();
|
||||
if (widgetIndex < 0 || widgetIndex >= widgets.length) {
|
||||
setWidgetsForSection(sectionId, widgets);
|
||||
return;
|
||||
}
|
||||
var newWidget = cloneWidgetData(widgets[widgetIndex]);
|
||||
newWidget.diskUsageMode = mode;
|
||||
widgets[widgetIndex] = newWidget;
|
||||
setWidgetsForSection(sectionId, widgets);
|
||||
}
|
||||
|
||||
function handleOverflowSettingChanged(sectionId, widgetIndex, settingName, value) {
|
||||
var widgets = getWidgetsForSection(sectionId).slice();
|
||||
if (widgetIndex < 0 || widgetIndex >= widgets.length) {
|
||||
@@ -615,6 +629,8 @@ Item {
|
||||
item.pciId = widget.pciId;
|
||||
if (widget.mountPath !== undefined)
|
||||
item.mountPath = widget.mountPath;
|
||||
if (widget.diskUsageMode !== undefined)
|
||||
item.diskUsageMode = widget.diskUsageMode;
|
||||
if (widget.showNetworkIcon !== undefined)
|
||||
item.showNetworkIcon = widget.showNetworkIcon;
|
||||
if (widget.showBluetoothIcon !== undefined)
|
||||
@@ -944,6 +960,9 @@ Item {
|
||||
onShowInGbChanged: (sectionId, index, enabled) => {
|
||||
widgetsTab.handleShowInGbChanged(sectionId, index, enabled);
|
||||
}
|
||||
onDiskUsageModeChanged: (sectionId, widgetIndex, mode) => {
|
||||
widgetsTab.handleDiskUsageModeChanged(sectionId, widgetIndex, mode);
|
||||
}
|
||||
onCompactModeChanged: (widgetId, value) => {
|
||||
widgetsTab.handleCompactModeChanged(sectionId, widgetId, value);
|
||||
}
|
||||
@@ -1005,6 +1024,9 @@ Item {
|
||||
onShowInGbChanged: (sectionId, index, enabled) => {
|
||||
widgetsTab.handleShowInGbChanged(sectionId, index, enabled);
|
||||
}
|
||||
onDiskUsageModeChanged: (sectionId, widgetIndex, mode) => {
|
||||
widgetsTab.handleDiskUsageModeChanged(sectionId, widgetIndex, mode);
|
||||
}
|
||||
onCompactModeChanged: (widgetId, value) => {
|
||||
widgetsTab.handleCompactModeChanged(sectionId, widgetId, value);
|
||||
}
|
||||
@@ -1066,6 +1088,9 @@ Item {
|
||||
onShowInGbChanged: (sectionId, index, enabled) => {
|
||||
widgetsTab.handleShowInGbChanged(sectionId, index, enabled);
|
||||
}
|
||||
onDiskUsageModeChanged: (sectionId, widgetIndex, mode) => {
|
||||
widgetsTab.handleDiskUsageModeChanged(sectionId, widgetIndex, mode);
|
||||
}
|
||||
onCompactModeChanged: (widgetId, value) => {
|
||||
widgetsTab.handleCompactModeChanged(sectionId, widgetId, value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user