]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/datavgen.cpp
Fix discrepancy between different ways of measuring text extents under Mac.
[wxWidgets.git] / src / generic / datavgen.cpp
index 74aba29bd9a6fb895dd96f721ce2c0ebf61b5fb7..04924b89dd768188e34d234c48c71ee703d739e2 100644 (file)
@@ -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();