Skip to content

feat(app): System theme title bar follows the Windows accent - #59

Merged
FedeB2160 merged 1 commit into
mainfrom
claude/v2-titlebar-accent
Nov 11, 2026
Merged

FedeB2160 merged 1 commit into
mainfrom
claude/v2-titlebar-accent

Conversation

@FedeB2160

Copy link
Copy Markdown
Owner

Summary

  • With the System theme and Show accent color on title bars and window borders on in Windows (HKCU\Software\Microsoft\Windows\DWM\ColorPrevalence = 1), TitleBar.cs sets DWMWA_BORDER_COLOR, DWMWA_CAPTION_COLOR and DWMWA_TEXT_COLOR to DWMWA_COLOR_DEFAULT, so Windows draws the accent (inactive windows included). With the setting off, System is light or dark as before.
  • Light and Dark keep the app's title bar color, unchanged.
  • TitleBar.ApplyAll() redoes every open window on a theme change in Settings and on SystemEvents.UserPreferenceChanged (unhooked on exit), so the switch and the accent color follow with the app open.
  • Dated note in ADR 0027 with the Windows 10 limit; CHANGELOG line.

Test plan

  • dotnet test --solution app\WinGetStudio.sln: 301 tests, 0 failed (2 live skipped); new UseSystemAccent theory (4 cases), smoke test now calls ApplyAll on theme change
  • Windows 11 by hand: System + setting on shows the accent, inactive like other apps; switching the setting off/on and changing the accent follow live; Light/Dark with the setting on show no accent; Settings, About and a confirmation dialog follow
  • Windows 10 22H2 VM (self-contained publish): System shows the accent; Light/Dark keep it (expected, no attributes 34-36); nothing else breaks

🤖 Generated with Claude Code

With the System theme and "Show accent color on title bars and window
borders" on in Windows (DWM\ColorPrevalence = 1), TitleBar sets border,
caption and text color to DWMWA_COLOR_DEFAULT and Windows draws the
accent, inactive windows included. Light and Dark keep the app's color.
All open windows are redone on a theme change in Settings and on
SystemEvents.UserPreferenceChanged.

Checked by hand on Windows 11 and on Windows 10 22H2 in a VM; on
Windows 10 the accent stays in every theme (no attributes 34-36),
noted in ADR 0027.

Co-Authored-By: Claude <noreply@anthropic.com>
@FedeB2160
FedeB2160 merged commit 6e6d621 into main Nov 11, 2026
3 checks passed
@FedeB2160
FedeB2160 deleted the claude/v2-titlebar-accent branch November 11, 2026 16:15
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