Repository navigation
Follow Windows light and dark mode in the haze - #18
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Second of five steps toward separate light and dark mode settings on Windows (after #17).
AppsUseLightThemeunderHKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize) and follows changes live throughSystemEvents.UserPreferenceChanged.SeparateAppearanceis on, the haze usesIntensityDarkandHazeColorDark; otherwise the normal values. The engine, tray slider, percent label, hotkeys and scroll wheel all go throughCurrentIntensity/CurrentColor, andSetIntensityadjusts whichever intensity is in effect, like the macOS app'ssetCurrentIntensity.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
windows/test.batpasses.SetIntensityin dark mode changes only the dark value; a mode flip raises one redraw, a repeated identical flip none, and neither touchessettings.txt.