Introduce system color for GRIDLINES, map to NSColor gridColor on macOS. (PR #25785)

12 views
Skip to first unread message

Daniel Kulp

unread,
Sep 9, 2025, 7:08:31 PM (5 days ago) Sep 9
to wx-...@googlegroups.com, Subscribed

This introduces a new system color enum value for wxSYS_COLOUR_GRIDLINES which maps to BTNFACE on platforms other than macOS. On macOS, it will use the NSColor gridColor.

This also adjusts the property grid categories when in dark mode. If the color is too dark, it will lighten it slightly. This produces a fairly good looking property grid in dark mode:

Screenshot.2025-09-09.at.7.07.35.PM.png (view on web)

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

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

Commit Summary

  • 15b883e Introduce system color for GRIDLINES, map to NSColor gridColor on macOS.

File Changes

(9 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/25785@github.com>

VZ

unread,
Sep 9, 2025, 7:20:46 PM (5 days ago) Sep 9
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.

I'm not sure how to reconcile this with your comment about gridColor not really working, but if it works, all the better!

Please just fix the build failures and then we could merge this.

Thanks!


In include/wx/settings.h:

> @@ -91,6 +92,7 @@ enum wxSystemColour
     wxSYS_COLOUR_3DHIGHLIGHT = wxSYS_COLOUR_BTNHIGHLIGHT,
     wxSYS_COLOUR_3DHILIGHT = wxSYS_COLOUR_BTNHIGHLIGHT,
     wxSYS_COLOUR_FRAMEBK = wxSYS_COLOUR_BTNFACE
+    
⬇️ Suggested change
-    

In interface/wx/settings.h:

> @@ -115,7 +115,13 @@ enum wxSystemColour
      */
     wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT,
 
-
+    /**
+        On macOS, this maps to [NSColor gridLines], on other platforms
+        it's mapped to wxSYS_COLOUR_BTNFACE
+        @since 3.3
⬇️ Suggested change
-        @since 3.3
+        @since 3.3.2

In src/propgrid/propgrid.cpp:

> +    #ifdef __WXOSX__
+        if (wxSystemSettings::GetAppearance().IsDark())
+        {
+            // Make sure colour is light enough
+            int colDec = wxPGGetColAvg(col);
+            if (colDec < 30)
+                col = wxPGAdjustColour(col, 20);
+        }

To be honest, I find this code quite incomprehensible, but then the existing version was already so. I wonder if we can abstract this to some function with a readable name?


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/25785/review/3203712146@github.com>

Daniel Kulp

unread,
Sep 9, 2025, 7:40:24 PM (5 days ago) Sep 9
to wx-...@googlegroups.com, Push

@dkulp pushed 1 commit.


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

Daniel Kulp

unread,
Sep 9, 2025, 7:44:51 PM (5 days ago) Sep 9
to wx-...@googlegroups.com, Subscribed
dkulp left a comment (wxWidgets/wxWidgets#25785)

I'm not sure how to reconcile this with your comment about gridColor not really working, but if it works, all the better!

Please just fix the build failures and then we could merge this.

Thanks!

The main issue is that gridColor was too dark for the PropertyGrid categories. It's "kind of" too dark (IMO) for wxGrid in dark mode, but it's at least visible. gridColor does work quite well in light mode.

Screenshot.2025-09-09.at.7.42.37.PM.png (view on web) Screenshot.2025-09-09.at.7.42.24.PM.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/25785/c3272646476@github.com>

Daniel Kulp

unread,
Sep 9, 2025, 7:45:49 PM (5 days ago) Sep 9
to wx-...@googlegroups.com, Push

@dkulp pushed 1 commit.


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

Reply all
Reply to author
Forward
0 new messages