[Light Switch] Switch desktop wallpapers with the Light/Dark mode (#42624)

I'm not sure how to set the AccentColor and ColorizationColor that is
consistent with the Settings App, and the same goes for switching
themes. If anyone has a solution, please let me know.


<img width="2010" height="1274" alt="2025-10-26 235808"
src="https://github.com/user-attachments/assets/b3eda45a-09f3-43bc-b87c-1b05bc308c24"
/>


- [x] Closes: #42436
- [ ] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [x] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx

---------

Co-authored-by: Jaylyn Barbee <51131738+Jaylyn-Barbee@users.noreply.github.com>
This commit is contained in:
Yexuan Xiao
2026-01-07 01:55:55 +08:00
committed by GitHub
parent d9709b2b91
commit 19c9b4e1fd
25 changed files with 1118 additions and 310 deletions

View File

@@ -17,6 +17,10 @@ namespace Microsoft.PowerToys.Settings.UI.Library
public const string DefaultLatitude = "0.0";
public const string DefaultLongitude = "0.0";
public const string DefaultScheduleMode = "Off";
public const bool DefaultWallpaperEnabled = false;
public const bool DefaultWallpaperVirtualDesktopEnabled = false;
public const int DefaultWallpaperStyle = 0;
public const string DefaultWallpaperPath = "";
public static readonly HotkeySettings DefaultToggleThemeHotkey = new HotkeySettings(true, true, false, true, 0x44); // Ctrl+Win+Shift+D
public LightSwitchProperties()
@@ -30,6 +34,12 @@ namespace Microsoft.PowerToys.Settings.UI.Library
SunriseOffset = new IntProperty(DefaultSunriseOffset);
SunsetOffset = new IntProperty(DefaultSunsetOffset);
ScheduleMode = new StringProperty(DefaultScheduleMode);
WallpaperEnabled = new BoolProperty(DefaultWallpaperEnabled);
WallpaperVirtualDesktopEnabled = new BoolProperty(DefaultWallpaperVirtualDesktopEnabled);
WallpaperStyleLight = new IntProperty(DefaultWallpaperStyle);
WallpaperStyleDark = new IntProperty(DefaultWallpaperStyle);
WallpaperPathLight = new StringProperty(DefaultWallpaperPath);
WallpaperPathDark = new StringProperty(DefaultWallpaperPath);
ToggleThemeHotkey = new KeyboardKeysProperty(DefaultToggleThemeHotkey);
}
@@ -62,5 +72,23 @@ namespace Microsoft.PowerToys.Settings.UI.Library
[JsonPropertyName("toggle-theme-hotkey")]
public KeyboardKeysProperty ToggleThemeHotkey { get; set; }
[JsonPropertyName("wallpaperEnabled")]
public BoolProperty WallpaperEnabled { get; set; }
[JsonPropertyName("wallpaperVirtualDesktopEnabled")]
public BoolProperty WallpaperVirtualDesktopEnabled { get; set; }
[JsonPropertyName("wallpaperStyleLight")]
public IntProperty WallpaperStyleLight { get; set; }
[JsonPropertyName("wallpaperStyleDark")]
public IntProperty WallpaperStyleDark { get; set; }
[JsonPropertyName("wallpaperPathLight")]
public StringProperty WallpaperPathLight { get; set; }
[JsonPropertyName("wallpaperPathDark")]
public StringProperty WallpaperPathDark { get; set; }
}
}