Add Windows dark-mode theming to downloader UI#4
Conversation
Co-authored-by: mrbbbaixue <17956756+mrbbbaixue@users.noreply.github.com>
Co-authored-by: mrbbbaixue <17956756+mrbbbaixue@users.noreply.github.com>
Co-authored-by: mrbbbaixue <17956756+mrbbbaixue@users.noreply.github.com>
Co-authored-by: mrbbbaixue <17956756+mrbbbaixue@users.noreply.github.com>
Co-authored-by: mrbbbaixue <17956756+mrbbbaixue@users.noreply.github.com>
Co-authored-by: mrbbbaixue <17956756+mrbbbaixue@users.noreply.github.com>
Co-authored-by: mrbbbaixue <17956756+mrbbbaixue@users.noreply.github.com>
Co-authored-by: mrbbbaixue <17956756+mrbbbaixue@users.noreply.github.com>
Co-authored-by: mrbbbaixue <17956756+mrbbbaixue@users.noreply.github.com>
Co-authored-by: mrbbbaixue <17956756+mrbbbaixue@users.noreply.github.com>
Co-authored-by: mrbbbaixue <17956756+mrbbbaixue@users.noreply.github.com>
Co-authored-by: mrbbbaixue <17956756+mrbbbaixue@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds Windows high-version dark mode support to the WPF downloader application. When Windows is in dark mode, the application now detects this via registry settings and applies dark theme colors (black background, white text, and dark progress bar).
- Implements registry-based Windows dark mode detection
- Applies dark theme styling to window and progress bar controls
- Adds comprehensive exception handling for registry access failures
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private const int DarkModeRegistryValue = 0; // 0 means AppsUseLightTheme is false (dark mode enabled) | ||
| private static readonly Brush DarkBackgroundBrush = Brushes.Black; |
There was a problem hiding this comment.
The static brush fields defined here are never used in the code. The ApplySystemTheme method directly uses Brushes.Black and Brushes.White instead of these DarkBackgroundBrush and DarkForegroundBrush fields. Either use these fields in ApplySystemTheme or remove them to avoid unnecessary code.
| { | ||
| return; | ||
| } | ||
|
|
There was a problem hiding this comment.
Setting only the Background property of the ProgressBar to black will not provide proper dark mode styling. In dark mode, the ProgressBar's foreground (the filled portion) should remain visible against the black background. Consider setting the Foreground property of DownloadProgressBar to a light color or adjusting other styling properties to ensure the progress indicator remains visible in dark mode.
| return; | ||
| } | ||
|
|
There was a problem hiding this comment.
Setting only the window's Background and Foreground properties won't automatically apply dark mode styling to all child controls. The Hyperlink, TextBlocks, and RadioButtons will retain their default styling and may not be readable in dark mode. Consider applying dark theme colors to these controls as well, or use a comprehensive WPF theming solution.
Co-authored-by: mrbbbaixue <17956756+mrbbbaixue@users.noreply.github.com>
High Windows versions should render the downloader in dark mode (black background/white text, matching progress bar) when the OS is in dark theme.
Dark-mode detection
AppsUseLightThemefromHKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize; treat value0as dark mode.Theming application
Example:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.