Prefer to use standard selection colour in wxDataViewCustomRenderer.
We currently don't allow customizing the background colour of the selected items which is always the system standard colour and so we should also use the system standard selection foreground colour as a combination of a custom foreground and standard background may be completely unreadable. Notice that it is still possible to use custom colour if really needed from a custom renderer by removing wxDATAVIEW_CELL_SELECTED from the flags before calling the base class version of RenderText(). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -727,11 +727,14 @@ wxDataViewCustomRenderer::RenderText(wxDC& dc,
|
|||||||
int state,
|
int state,
|
||||||
int xoffset)
|
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;
|
wxColour col;
|
||||||
if ( attr && attr->HasColour() )
|
if ( state & wxDATAVIEW_CELL_SELECTED )
|
||||||
col = attr->GetColour();
|
|
||||||
else if ( state & wxDATAVIEW_CELL_SELECTED )
|
|
||||||
col = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
|
col = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
|
||||||
|
else if ( attr && attr->HasColour() )
|
||||||
|
col = attr->GetColour();
|
||||||
else // use default foreground
|
else // use default foreground
|
||||||
col = GetOwner()->GetOwner()->GetForegroundColour();
|
col = GetOwner()->GetOwner()->GetForegroundColour();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user