Don't use custom colors in selected wxDVC controls (wxOSX)
Don't use custom color attributes or color markup for rendering of selected items' text in wxOSX's wxDataViewCtrl and use the selection text color instead. This is consistent with the other ports and should be done to improve readability (in absence of selection-specific attributes).
This commit is contained in:
parent
5e5ffad0b8
commit
d9df970573
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user