Use Cocoa methods instead of wx ones in wxDVC font setting code.
Use NSFontManager to create bold or italic version of the font instead of using wxFont. This works better for the bold attribute, but setting the italic one still doesn't do anything. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62388 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1525,12 +1525,19 @@ wxWidgetImplType* CreateDataView(wxWindowMac* wxpeer, wxWindowMac* WXUNUSED(pare
|
||||
{
|
||||
if ( attr.HasFont() )
|
||||
{
|
||||
wxFont font(dvc->GetFont());
|
||||
if ( attr.GetBold() )
|
||||
font.MakeBold();
|
||||
if ( attr.GetItalic() )
|
||||
font.MakeItalic();
|
||||
[cell setFont:font.OSXGetNSFont()];
|
||||
// FIXME: using wxFont methods here doesn't work for some reason
|
||||
NSFontManager * const fm = [NSFontManager sharedFontManager];
|
||||
NSFont *font = [cell font];
|
||||
if ( font )
|
||||
{
|
||||
if ( attr.GetBold() )
|
||||
font = [fm convertFont:font toHaveTrait:NSBoldFontMask];
|
||||
if ( attr.GetItalic() )
|
||||
font = [fm convertFont:font toHaveTrait:NSItalicFontMask];
|
||||
|
||||
[cell setFont:font];
|
||||
}
|
||||
//else: can't change font if the cell doesn't have any
|
||||
}
|
||||
|
||||
// we can set font for any cell but only NSTextFieldCell provides a
|
||||
|
Reference in New Issue
Block a user