Skip to content

win32 dark mode: fields wear a dark edge, the accent colour while focused - #173

Merged
nicolas-maman merged 2 commits into
mainfrom
feat/win32-dark-field-frame
Sep 19, 2026
Merged

nicolas-maman merged 2 commits into
mainfrom
feat/win32-dark-field-frame

Conversation

@nicolas-maman

Copy link
Copy Markdown
Contributor

A design fix for the dark theme on Windows. DarkMode_CFD darkens an EDIT and what it draws inside, but the sunken client edge around it (WS_EX_CLIENTEDGE, two pixels of non-client area the system draws in its 3D colours) stayed a white two-pixel box around every field and text area on the dark ground — the form example looked wired in white.

  • styled_field_proc is now installed on every field and text area at creation (it used to be installed only when a sheet gave the field a border) and paints the edge in WM_NCPAINT:
    • a sheet border, at the width and colour asked for (as before);
    • otherwise, on a dark system, the dark frame Explorer's fields wear (#454545, one pixel, the inner ring the field's ground), and the user's accent colour while the field has the focus — what a Windows 11 text box does;
    • otherwise nothing: the light theme's edge is the system's own.
  • WM_SETFOCUS / WM_KILLFOCUS repaint the frame; the theme flip (ImmersiveColorSet) repaints every frame along with the grounds (RDW_FRAME).
  • w32_accent_color() reads the accent from DWM (DwmGetColorizationColor); the progress bar's fill uses it too instead of a hard-coded blue.

Captured through the driver on this box (system dark, accent red): fields and the text area in a subtle dark frame; the focused Name field in the accent; the progress fill in the accent. Verified natively: runtime test, 14 headless and 10 on-screen driver specs unchanged.

…used

The dark theme class darkens an EDIT and what it draws inside, but the
sunken client edge around it is the system's, drawn in its 3D colours,
and stayed a white two-pixel line on the dark ground: a form on a dark
system had every field and its text area boxed in white. Every field and
text area now paints its own edge in WM_NCPAINT (styled_field_proc,
installed at creation rather than only for a sheet border): a sheet
border at the width and colour asked for; otherwise, on a dark system,
the dark frame Explorer's fields wear, in the user's accent colour while
the field has the focus, which is what a Windows 11 text box does;
otherwise the system's own. Focus changes repaint the frame, and the
theme flip repaints every frame with the grounds. The progress fill is
the accent colour too (w32_accent_color, DwmGetColorizationColor) rather
than a hard-coded blue.

Verified natively: runtime test, 14 headless and 10 on-screen specs, and
captures of the form example at rest and focused.
…-frame

# Conflicts:
#	CHANGELOG.md
#	backend/aether_ui_win32.c
@nicolas-maman
nicolas-maman merged commit 9ea572f into main Sep 19, 2026
3 checks passed
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