Skip to content

Follow Windows light and dark mode in the haze - #18

Merged
jay739 merged 1 commit into
mainfrom
feat/windows-dark-mode-follow-theme
Nov 13, 2026
Merged

jay739 merged 1 commit into
mainfrom
feat/windows-dark-mode-follow-theme

Conversation

@jay739

@jay739 jay739 commented Nov 13, 2026

Copy link
Copy Markdown
Owner

What

Second of five steps toward separate light and dark mode settings on Windows (after #17).

  • At startup OpenHaze reads Windows' app mode (AppsUseLightTheme under HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize) and follows changes live through SystemEvents.UserPreferenceChanged.
  • While Windows is in dark mode and SeparateAppearance is on, the haze uses IntensityDark and HazeColorDark; otherwise the normal values. The engine, tray slider, percent label, hotkeys and scroll wheel all go through CurrentIntensity / CurrentColor, and SetIntensity adjusts whichever intensity is in effect, like the macOS app's setCurrentIntensity.
  • A mode flip only redraws; it does not rewrite settings.txt.

The switch is still off by default with no control yet, so behavior is unchanged. Next: the Settings window controls, then the docs.

Why

Lets the haze be lighter or darker to suit a dark desktop, as macOS users can already do.

How it was tested

  • Built with the bundled csc.exe, no warnings; windows/test.bat passes.
  • Against the compiled code: dark-mode detection matches the registry value; with the switch off the normal values apply even in dark mode; with it on, dark mode uses the dark values and light mode the normal ones; SetIntensity in dark mode changes only the dark value; a mode flip raises one redraw, a repeated identical flip none, and neither touches settings.txt.
  • Not yet tried: a live theme switch with the app running. That is easiest once the Settings window has the switch.

Second step of light and dark mode settings on Windows. At startup OpenHaze
reads Windows' app mode (AppsUseLightTheme) and follows changes live through
SystemEvents.UserPreferenceChanged. While Windows is in dark mode and the
separate-appearance switch is on, the haze uses the dark-mode intensity and
color; otherwise it uses the normal ones.

The tray slider, percent label, hotkeys and scroll wheel now adjust whichever
intensity is in effect, as the macOS app does. A mode flip only redraws; it
does not rewrite settings.txt. The switch is still off by default and has no
control yet, so behavior is unchanged until the Settings window gains one.
@jay739
jay739 merged commit 4476ba3 into main Nov 13, 2026
3 checks passed
@jay739
jay739 deleted the feat/windows-dark-mode-follow-theme branch November 13, 2026 19:36
@jay739 jay739 mentioned this pull request Nov 15, 2026
5 of 10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant