Repository navigation
Conversation
The Dimming group gets a "Use a different haze intensity and color when Windows is in dark mode" switch, plus a "Dark mode" intensity slider and color row that stay greyed out until it is on. Each slider and color row sets its own stored value. The tray slider and hotkeys still adjust whichever value is in effect, but here the normal row always edits the light value, so moving it in dark mode no longer changes the dark one. Two helpers build the slider and color rows, so the dark rows reuse the same code. Slider rows sit 36 px apart, because a TrackBar is 45 px tall whatever height it is given and closer rows hide the lower slider's track. The color rows also move clear of the Fade slider, which used to cover the top edge of their buttons.
jay739
force-pushed
the
feat/windows-dark-mode
branch
from
November 15, 2026 00:34
e6edf85 to
d22f37a
Compare
When Windows is in dark mode as the Settings window opens, the title bar turns dark and every control gets dark colors close to Windows 11's own dark windows. Buttons switch to a flat style, because a standard button ignores its background color and stays light. Hints stay dimmer than the rest of the text, and the color swatches keep showing the haze color. In dark mode the greyed-out "Dark mode" rows dim their labels by color instead of disabling them, because Windows draws disabled label text with a light shadow that smudges on a dark background. SetDarkTitleBar tries the attribute Windows 10 version 2004 and later use, then the one earlier Windows 10 builds used. Windows 7 and 8 reject both and keep their normal title bar.
The Settings window now listens for the settings' Changed event while it is open and redraws itself light or dark when Windows switches, instead of keeping the look it opened with. Changed also fires for every setting saved from the window, so it acts only when light or dark actually differs from how the window is drawn, and it stops listening when the window closes. The dark colors now come off again too: buttons go back to the standard style, the shortcut boxes to white with the normal border, hints to the normal grey, and greyed-out labels back to the normal disabled look. Hints are tagged so they get the right grey both ways. SetDarkTitleBar also asks Windows for a frame change, because Windows 10 repaints an open window's title bar only after one.
A new Theme choice in the System group of the Settings window offers Match Windows (the default, which keeps following Windows live), Light and Dark. The choice is saved with the other settings, and values outside 0 to 2 in a hand-edited settings.txt are clamped. UseDarkTheme combines it with Windows' mode. It affects only OpenHaze's own window: the haze's dark-mode intensity and color still follow Windows, because a dark desktop needs a lighter haze whatever color the Settings window is. The dark-mode switch in the Dimming group now sits directly above the two rows it controls, which are indented under it, and the rows above go back to the released order: Intensity, Fade, Haze color. Every row under a slider now starts 48 px below its top, because a TrackBar is 45 px tall whatever height it is given; the Intensity and Fade sliders used to overlap by 9 px, so the upper one took clicks meant for the lower one.
This branch has not been deployed
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
The Windows app follows Windows light and dark mode, in two ways:
This PR collects the rest of the feature, one step a day:
The groundwork already landed in #17 (the stored dark-mode values) and #18 (following the Windows theme and using those values for the haze).
The color picker and the pop-up messages (About, update prompts) are Windows' own dialogs and stay light. The tray menu is out of scope here.
Why
A dark desktop already looks dimmer, so the haze that suits a light theme is usually too strong on a dark one. macOS users can set the two apart, and Windows users could not. And a bright white Settings window on a dark desktop looks out of place next to everything else.
How it was tested
windows\test.bat, 15 checks), and the build has no warningswindows/testsyet, because that suite only covers the update checker. The Settings window was driven by a script against the built exe instead: the dark rows start greyed out, the switch enables them and is saved, each slider changes only its own value, the value in effect in dark mode is the dark one, and turning the switch off greys the rows again (7 of 7 pass). A second script opens the window as if Windows were light, dark, and dark with the dark rows greyed out, and checks the title bar, every button and text box, the hints, the swatches and the greyed-out labels (22 of 22 pass). A third switches Windows between light and dark underneath an open window and checks it follows both ways, stays put when a setting is saved, and stops listening once closed; after the round trip it matches a freshly opened light window pixel for pixel (19 of 19 pass). A fourth covers the Theme choice: saving and loading it (hand-edited values clamped), all six combinations of choice and Windows mode, the haze ignoring it, the three buttons switching the window live, the indented rows, and a scan that no two controls in the window overlap (19 of 19 pass). Rendering with modern visual styles caught sliders overlapping each other, and the overlap scan caught one more that dated back to the original layout