1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-05-02 02:22:06 -04:00

fix syncWallpaperForCurrentMode

This commit is contained in:
bbedward
2026-03-27 09:35:39 -04:00
parent 4e14cf5cce
commit 1715e2eab7

View File

@@ -338,8 +338,8 @@ Singleton {
function setLightMode(lightMode) {
isSwitchingMode = true;
syncWallpaperForCurrentMode(lightMode);
isLightMode = lightMode;
syncWallpaperForCurrentMode();
saveSettings();
Qt.callLater(() => {
isSwitchingMode = false;
@@ -1091,15 +1091,16 @@ Singleton {
saveSettings();
}
function syncWallpaperForCurrentMode() {
function syncWallpaperForCurrentMode(mode) {
if (!perModeWallpaper)
return;
var light = (mode !== undefined) ? mode : isLightMode;
if (perMonitorWallpaper) {
monitorWallpapers = isLightMode ? Object.assign({}, monitorWallpapersLight) : Object.assign({}, monitorWallpapersDark);
monitorWallpapers = light ? Object.assign({}, monitorWallpapersLight) : Object.assign({}, monitorWallpapersDark);
return;
}
wallpaperPath = isLightMode ? wallpaperPathLight : wallpaperPathDark;
wallpaperPath = light ? wallpaperPathLight : wallpaperPathDark;
}
function _findMonitorValue(map, screenName) {