Fix custom foreground colour of selected items in dark mode

Keep the item colour instead of unconditionally replacing it with the
highlight colour in dark mode too, for consistency with white mode.

Closes #25633.
This commit is contained in:
Maarten Bent
2025-12-14 16:51:20 +01:00
committed by Vadim Zeitlin
parent 31966f7d66
commit aaa15aad6d
+1 -1
View File
@@ -3408,7 +3408,7 @@ void HandleItemPaint(wxListCtrl* listctrl, LPNMLVCUSTOMDRAW pLVCD)
? wxColourToRGB(attr->GetTextColour())
: wxColourToRGB(listctrl->GetTextColour());
pLVCD->clrTextBk = clrFullBG;
if ( nmcd.uItemState & CDIS_SELECTED )
if ( nmcd.uItemState & CDIS_SELECTED && !(attr && attr->HasTextColour()) )
pLVCD->clrText = wxColourToRGB(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT));
if ( !(nmcd.uItemState & CDIS_SELECTED) && !(nmcd.uItemState & CDIS_HOT)
&& attr && attr->HasBackgroundColour() )