diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index fac25931ab..b146e962f5 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -2733,7 +2733,7 @@ void wxDataViewRenderer::SetAttr(const wxDataViewItemAttr& attr) //else: can't change font if the cell doesn't have any } - if ( attr.HasColour() ) + if ( attr.HasColour() && ![cell isHighlighted] ) { // we can set font for any cell but only NSTextFieldCell provides // a method for setting text colour so check that this method is @@ -2842,6 +2842,12 @@ bool wxDataViewTextRenderer::MacRender() [par release]; } + if ( [cell isHighlighted] ) + { + [str removeAttribute:NSForegroundColorAttributeName range:NSMakeRange(0, [str length])]; + [str removeAttribute:NSBackgroundColorAttributeName range:NSMakeRange(0, [str length])]; + } + [cell setAttributedStringValue:str]; return true; }