1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-03 20:32:07 -04:00

fix syncWallpaperForCurrentMode

This commit is contained in:
bbedward
2026-03-27 09:35:39 -04:00
parent 5ee93a67fe
commit 521a3fa6e8

View File

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