mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-27 06:52:50 -05:00
widgets: add spacer, divider, tweak interface
This commit is contained in:
@@ -1,25 +1,24 @@
|
||||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import qs.Common
|
||||
pragma Singleton
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
// Clear all image cache
|
||||
function clearImageCache() {
|
||||
Quickshell.execDetached(["rm", "-rf", Paths.stringify(Paths.imagecache)])
|
||||
Paths.mkdir(Paths.imagecache)
|
||||
Quickshell.execDetached(["rm", "-rf", Paths.stringify(Paths.imagecache)]);
|
||||
Paths.mkdir(Paths.imagecache);
|
||||
}
|
||||
|
||||
// Clear cache older than specified minutes
|
||||
function clearOldCache(ageInMinutes) {
|
||||
Quickshell.execDetached(["find", Paths.stringify(Paths.imagecache), "-name", "*.png", "-mmin", `+${ageInMinutes}`, "-delete"])
|
||||
Quickshell.execDetached(["find", Paths.stringify(Paths.imagecache), "-name", "*.png", "-mmin", `+${ageInMinutes}`, "-delete"]);
|
||||
}
|
||||
|
||||
// Clear cache for specific size
|
||||
function clearCacheForSize(size) {
|
||||
Quickshell.execDetached(["find", Paths.stringify(Paths.imagecache), "-name", `*@${size}x${size}.png`, "-delete"])
|
||||
Quickshell.execDetached(["find", Paths.stringify(Paths.imagecache), "-name", `*@${size}x${size}.png`, "-delete"]);
|
||||
}
|
||||
|
||||
// Get cache size in MB
|
||||
@@ -36,6 +35,7 @@ Singleton {
|
||||
}
|
||||
}
|
||||
}
|
||||
`, root)
|
||||
`, root);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -500,7 +500,13 @@ Singleton {
|
||||
// Handle both old string format and new object format
|
||||
var widgetId = typeof order[i] === "string" ? order[i] : order[i].id;
|
||||
var enabled = typeof order[i] === "string" ? true : order[i].enabled;
|
||||
listModel.append({"widgetId": widgetId, "enabled": enabled});
|
||||
var size = typeof order[i] === "string" ? undefined : order[i].size;
|
||||
|
||||
var item = {"widgetId": widgetId, "enabled": enabled};
|
||||
if (size !== undefined) {
|
||||
item.size = size;
|
||||
}
|
||||
listModel.append(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
|
||||
QtObject {
|
||||
required property Singleton service
|
||||
|
||||
Component.onCompleted: service.refCount++
|
||||
Component.onDestruction: service.refCount--
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user