mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 07:52:50 -05:00
@@ -39,6 +39,12 @@ Variants {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
|
||||
function encodeFileUrl(path) {
|
||||
if (!path)
|
||||
return "";
|
||||
return "file://" + path.split('/').map(s => encodeURIComponent(s)).join('/');
|
||||
}
|
||||
|
||||
property string source: SessionData.getMonitorWallpaper(modelData.name) || ""
|
||||
property bool isColorSource: source.startsWith("#")
|
||||
property string transitionType: SessionData.wallpaperTransition
|
||||
@@ -108,7 +114,7 @@ Variants {
|
||||
isInitialized = true;
|
||||
return;
|
||||
}
|
||||
const formattedSource = source.startsWith("file://") ? source : "file://" + source;
|
||||
const formattedSource = source.startsWith("file://") ? source : encodeFileUrl(source);
|
||||
setWallpaperImmediate(formattedSource);
|
||||
isInitialized = true;
|
||||
}
|
||||
@@ -119,7 +125,7 @@ Variants {
|
||||
return;
|
||||
}
|
||||
|
||||
const formattedSource = source.startsWith("file://") ? source : "file://" + source;
|
||||
const formattedSource = source.startsWith("file://") ? source : encodeFileUrl(source);
|
||||
|
||||
if (!isInitialized || !currentWallpaper.source) {
|
||||
setWallpaperImmediate(formattedSource);
|
||||
|
||||
Reference in New Issue
Block a user