X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/795dac4c866d89804e625fa1d04cb70aba320183..0738b901b17340f09766524b8d9d79e9ed1268e7:/src/generic/datavgen.cpp diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 74aba29bd9..04924b89dd 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -727,11 +727,14 @@ wxDataViewCustomRenderer::RenderText(wxDC& dc, int state, int xoffset) { + // override custom foreground with the standard one for the selected items + // because we currently don't allow changing the selection background and + // custom colours may be unreadable on it wxColour col; - if ( attr && attr->HasColour() ) - col = attr->GetColour(); - else if ( state & wxDATAVIEW_CELL_SELECTED ) + if ( state & wxDATAVIEW_CELL_SELECTED ) col = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); + else if ( attr && attr->HasColour() ) + col = attr->GetColour(); else // use default foreground col = GetOwner()->GetOwner()->GetForegroundColour();