Generic wxListCtrl: Fix colors when system theme changes (PR #26141)

16 views
Skip to first unread message

Ricardo J. Ricken

unread,
Jan 31, 2026, 5:05:49 PM (2 days ago) Jan 31
to wx-...@googlegroups.com, Subscribed

This PR addresses several issues when switching the system theme (e. g. light to dark mode) while using the generic wxListCtrl (default on GTK).

  1. wxListHeaderWindow: Added EVT_SYS_COLOUR_CHANGED handler to update foreground/background colors and fixed the sort arrow color, which now uses the window's foreground color to ensure visibility on dark headers.
  2. wxListMainWindow: Added EVT_SYS_COLOUR_CHANGED handler to update standard colors and the selection brushes (m_highlightBrush, m_highlightUnfocusedBrush).

Known Issue / Advice Wanted

While the content and headers now update perfectly, the border of the wxGenericListCtrl container does not update its color when the theme changes. It retains the color of the theme active at creation.

I tried many different approaches to force a refresh, but the underlying native GTK border does not seem to react to the system color change event. While I'm a long time user of wxWidgets, this is my first time working in the library internals, so I would appreciate any guidance on how to fix the border issue. Just point me in the right direction and I can give it a try.


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

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

Commit Summary

  • 653f5d6 Fix wxListHeaderWindow colors in dark mode
  • 5a8f256 Fix wxListMainWindow colors and highlight brushes in dark mode

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26141@github.com>

VZ

unread,
Jan 31, 2026, 5:41:21 PM (2 days ago) Jan 31
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26141)

Thanks for the fixes, they look good to me and we can merge this and probably backport it to 3.2 too.

Unfortunately I don't know what's going on with the borders neither.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26141/c3829495976@github.com>

Ricardo J. Ricken

unread,
Jan 31, 2026, 6:18:08 PM (2 days ago) Jan 31
to wx-...@googlegroups.com, Push

@rjricken pushed 1 commit.

  • 5d596c8 Fix wxListMainWindow colors and highlight brushes in dark mode


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26141/before/5a8f25660d4f8c0671c2b03ba4f94e55cc5c40f3/after/5d596c86ac6702b007827085bc8c3ba677982a86@github.com>

Ricardo J. Ricken

unread,
Feb 1, 2026, 9:48:30 AM (16 hours ago) Feb 1
to wx-...@googlegroups.com, Subscribed
rjricken left a comment (wxWidgets/wxWidgets#26141)

Sounds good. I can do the 3.2 backport next.
As for the borders, I'll give it another try.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26141/c3831150256@github.com>

Reply all
Reply to author
Forward
0 new messages