Improve disabled wxListCtrl in MSW darkmode (PR #25999)

33 views
Skip to first unread message

Maarten

unread,
Nov 29, 2025, 1:00:56 PM (4 days ago) Nov 29
to wx-...@googlegroups.com, Subscribed

Draw the background color outside the list-items area on all Windows version, both below and behind the items, and when the list is empty.

Set the text foreground and background colors when custom drawing. So the disabled list will use the correct colors in list or icon view.

Fixes #25990


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

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

Commit Summary

  • e5b6818 Improve disabled wxListCtrl in MSW darkmode

File Changes

(1 file)

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/25999@github.com>

VZ

unread,
Nov 29, 2025, 1:09:09 PM (4 days ago) Nov 29
to wx-...@googlegroups.com, Subscribed

@vadz approved this pull request.

I didn't test it yet, but this looks good, so I'll try to test it and merge it soon, thank you!


In src/msw/listctrl.cpp:

> @@ -3471,16 +3476,16 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
     const bool drawVRules = HasFlag(wxLC_VRULES);
 
     // Check if we need to do anything ourselves: either draw the rules or, in
-    // case of using dark mode under Windows 11, erase the unwanted separator
+    // case of using dark mode under Windows, erase the unwanted separator

Very minor, but it doesn't make sense to say "under Windows" in this Windows-only code:

⬇️ Suggested change
-    // case of using dark mode under Windows, erase the unwanted separator
+    // case of using dark mode, erase the unwanted separator


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/25999/review/3520778755@github.com>

Maarten

unread,
Nov 29, 2025, 1:11:33 PM (4 days ago) Nov 29
to wx-...@googlegroups.com, Subscribed

@MaartenBent commented on this pull request.


In src/msw/listctrl.cpp:

> @@ -3471,16 +3476,16 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
     const bool drawVRules = HasFlag(wxLC_VRULES);
 
     // Check if we need to do anything ourselves: either draw the rules or, in
-    // case of using dark mode under Windows 11, erase the unwanted separator
+    // case of using dark mode under Windows, erase the unwanted separator

Agreed, can you update this when merging?


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/25999/review/3520779903@github.com>

Maarten

unread,
Nov 29, 2025, 4:07:05 PM (3 days ago) Nov 29
to wx-...@googlegroups.com, Subscribed
MaartenBent left a comment (wxWidgets/wxWidgets#25999)

Found another issue, when hRules/vRules are enabled, we also have to erase the background.


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/25999/c3591939277@github.com>

Maarten

unread,
Nov 29, 2025, 6:10:14 PM (3 days ago) Nov 29
to wx-...@googlegroups.com, Subscribed
MaartenBent left a comment (wxWidgets/wxWidgets#25999)

And a regression of 4b2a57c (#25950). When resizing the column, and then moving the scrollbar right and left, it does not redraw correctly, investigating...

Screenshot.2025-11-30.000815.png (view on web)


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/25999/c3592012797@github.com>

Maarten

unread,
Nov 29, 2025, 7:20:26 PM (3 days ago) Nov 29
to wx-...@googlegroups.com, Push

@MaartenBent pushed 3 commits.

  • ecfaa59 Improve disabled wxListCtrl in MSW dark mode
  • d26f7a8 Improve drawing wxListCtrl gird lines in dark mode
  • b2ada52 Fix incorrect wxListCtrl::GetSubItemRect(n, 0)


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

Maarten

unread,
Nov 30, 2025, 7:50:45 AM (3 days ago) Nov 30
to wx-...@googlegroups.com, Push

@MaartenBent pushed 1 commit.

  • 9216783 Correctly restore dark mode header in MSW wxListCtrl


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25999/before/b2ada524dce55596bf9d88e8fcaf6b8622ee5274/after/92167838aaa90a84b7df2c42baf8acd5bf0fad85@github.com>

Maarten

unread,
Nov 30, 2025, 10:12:51 AM (3 days ago) Nov 30
to wx-...@googlegroups.com, Push

@MaartenBent pushed 3 commits.

  • 907ab5f Fix MSW wxListCtrl custom colours in light mode
  • 10bac0f Improve drawing MSW wxListCtrl focus rect in dark mode
  • 47891ab Draw hot tracking highlight in MSW wxListCtrl 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/25999/before/92167838aaa90a84b7df2c42baf8acd5bf0fad85/after/47891abefe9e303f27a84654f5cee25fd7346fb8@github.com>

Maarten

unread,
Nov 30, 2025, 10:19:08 AM (3 days ago) Nov 30
to wx-...@googlegroups.com, Subscribed
MaartenBent left a comment (wxWidgets/wxWidgets#25999)

This is getting more and more changes, so testing is highly appreciated.

I added hot tracking in dark mode, but I don't really like the current colour. It is the closest colour I could find to the colour when hovering in the header. Maybe it should be more subtle/darker?

This change required using Explorer theme, to get all the custom draw calls. I don't see any side effects in Report view. In the other views items now have the bluish hover colour again, I could not find a way to use the same gray colour.
It is also possible to use Explorer in Report mode and DarkMode_Explorer in other modes, but I think having a bluish colour is better than having nothing.


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/25999/c3592676382@github.com>

Maarten

unread,
Nov 30, 2025, 3:16:33 PM (3 days ago) Nov 30
to wx-...@googlegroups.com, Push

@MaartenBent pushed 2 commits.

  • 96e7dcd Fix highlighting first item in MSW wxListCtrl in dark mode
  • 41a7420 Slightly increase text padding in MSW wxListCtrl 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/25999/before/47891abefe9e303f27a84654f5cee25fd7346fb8/after/41a7420f2d7b5de9dc9db978445f04337c7cc619@github.com>

Maarten

unread,
Dec 2, 2025, 7:15:43 PM (8 hours ago) Dec 2
to wx-...@googlegroups.com, Push

@MaartenBent pushed 3 commits.

  • 99fb774 Better fix for MSW wxListCtrl focus rect visibility
  • 8dc41cf Try to fix missing MSW wxListCtrl attribute colour in dark mode
  • b56c6ba Improve MSW wxListCtrl background attribute 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/25999/before/41a7420f2d7b5de9dc9db978445f04337c7cc619/after/b56c6bae7ca34194c0f90f8f9675aa94117b0d06@github.com>

Reply all
Reply to author
Forward
0 new messages