Use wxColour::OSXGetNSColor() instead of reproducing it

No real changes, just simplify wxOSX code by using the existing
wxColour::OSXGetNSColor() method instead of reproducing it in many places.
This commit is contained in:
Vadim Zeitlin
2015-11-26 23:54:28 +01:00
parent 200f24301c
commit bcd16394df
5 changed files with 7 additions and 35 deletions

View File

@@ -2402,10 +2402,7 @@ void wxWidgetCocoaImpl::SetBackgroundColour( const wxColour &col )
if ( [targetView respondsToSelector:@selector(setBackgroundColor:) ] )
{
[targetView setBackgroundColor:[NSColor colorWithCalibratedRed:(CGFloat) (col.Red() / 255.0)
green:(CGFloat) (col.Green() / 255.0)
blue:(CGFloat) (col.Blue() / 255.0)
alpha:(CGFloat) (col.Alpha() / 255.0)]];
[targetView setBackgroundColor: col.OSXGetNSColor()];
}
}
@@ -2668,10 +2665,7 @@ void wxWidgetCocoaImpl::SetFont(wxFont const& font, wxColour const&col, long, bo
if ([targetView respondsToSelector:@selector(setFont:)])
[targetView setFont: font.OSXGetNSFont()];
if ([targetView respondsToSelector:@selector(setTextColor:)])
[targetView setTextColor:[NSColor colorWithCalibratedRed:(CGFloat) (col.Red() / 255.0)
green:(CGFloat) (col.Green() / 255.0)
blue:(CGFloat) (col.Blue() / 255.0)
alpha:(CGFloat) (col.Alpha() / 255.0)]];
[targetView setTextColor: col.OSXGetNSColor()];
}
void wxWidgetCocoaImpl::SetToolTip(wxToolTip* tooltip)