MSW: Fix wxSpinButton dark mode switching (PR #26683)

3 views
Skip to first unread message

Steve Cornett

unread,
Jul 9, 2026, 4:35:41 PM (9 hours ago) Jul 9
to wx-...@googlegroups.com, Subscribed

This fixes the wxSpinButton when switching to dark mode. Starting with Windows 11 22H2, the updown control draws properly in dark mode after wxMSWDarkMode::AllowForWindow() is applied to it. Switching to dark mode makes that call. After the updown control is drawn properly dark, the wxSpinButton::OnPaint() inverted the colours, making it look light instead of dark.

The fix has two parts:

  1. Call MSWSetDarkOrLightMode() upon control creation. This causes the control draw properly upon startup on Windows 11 22H2 and later.
  2. Avoid inverting the colours for Windows 11 22H2 and later because they are already dark mode.

You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26683

Commit Summary

  • cfa354d Fix wxSpinButton dark mode switching

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26683@github.com>

Reply all
Reply to author
Forward
0 new messages