On Thu, 21 Jul 2022 10:05:21 -0700 (PDT) Andrea Asztalos wrote:
AA> In
https://github.com/wxWidgets/wxWidgets/blob/0a8f7233cc6fd55535ae36d7d96324e9eb755f2b/include/wx/generic/private/listctrl.h
AA> I tried out this replacement and worked well on macOS (at least for
AA> wxListCtrl):
AA>
AA> // get the colour to be used for drawing the rules
AA>
AA> wxColour GetRuleColour() const
AA>
AA> {
AA>
AA> //return wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT);
AA>
AA> return *wxLIGHT_GREY;
AA>
AA> }
AA>
AA> Could this change be potentially viable for Mac platforms?
Unfortunately no, I don't think so. It probably wouldn't look well with
the dark themes and, in any case, hardcoding a colour is almost never the
right thing to do.
We need to either find a system colour which works well for macOS too (in
both light and dark themes) or, maybe, try to do something smarter, like
find a colour based on the background colour used by the control.
Unfortunately we still don't have any generic way to do something like
this, there was a long "API for finding contrasting colours" thread on
wx-dev about a year ago but it petered out without any solution.
For now I think the least intrusive and likely to break something else
change fixing this would be to use wxSYS_COLOUR_GRAYTEXT instead of
wxSYS_COLOUR_3DLIGHT: I believe that disabled text should be visible on the
default background, but shouldn't be visible as much as the normal text
colour, so it looks like a decent choice. It works for me both under Mac
and under Linux with a light and a dark theme, so I'm going to commit this
to master and, perhaps, it could be backported to 3.2 later if we don't
find any problems with it.