reworked font handling for osx (was missing because of conflicts)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59646 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2009-03-20 15:07:31 +00:00
parent 529e491ce0
commit b2088388cc

View File

@@ -335,33 +335,26 @@ void wxWindowMac::DoSetWindowVariant( wxWindowVariant variant )
m_peer->SetData<ControlSize>(kControlEntireControl, kControlSizeTag, &size ) ; m_peer->SetData<ControlSize>(kControlEntireControl, kControlSizeTag, &size ) ;
#endif #endif
#if wxOSX_USE_COCOA_OR_CARBON
wxFont font ; wxFont font ;
#if wxOSX_USE_ATSU_TEXT wxOSXSystemFont systemFont = wxOSX_SYSTEM_FONT_NORMAL ;
ThemeFontID themeFont = kThemeSystemFont ;
// we will get that from the settings later
// and make this NORMAL later, but first
// we have a few calculations that we must fix
switch ( variant ) switch ( variant )
{ {
case wxWINDOW_VARIANT_NORMAL : case wxWINDOW_VARIANT_NORMAL :
themeFont = kThemeSystemFont ; systemFont = wxOSX_SYSTEM_FONT_NORMAL ;
break ; break ;
case wxWINDOW_VARIANT_SMALL : case wxWINDOW_VARIANT_SMALL :
themeFont = kThemeSmallSystemFont ; systemFont = wxOSX_SYSTEM_FONT_SMALL ;
break ; break ;
case wxWINDOW_VARIANT_MINI : case wxWINDOW_VARIANT_MINI :
// not always defined in the headers systemFont = wxOSX_SYSTEM_FONT_MINI ;
themeFont = 109 ;
break ; break ;
case wxWINDOW_VARIANT_LARGE : case wxWINDOW_VARIANT_LARGE :
themeFont = kThemeSystemFont ; systemFont = wxOSX_SYSTEM_FONT_NORMAL ;
break ; break ;
default: default:
@@ -369,36 +362,9 @@ void wxWindowMac::DoSetWindowVariant( wxWindowVariant variant )
break ; break ;
} }
font.MacCreateFromThemeFont( themeFont ) ; font.CreateSystemFont( systemFont ) ;
#else
CTFontUIFontType themeFont = kCTFontSystemFontType ;
switch ( variant )
{
case wxWINDOW_VARIANT_NORMAL :
themeFont = kCTFontSystemFontType;
break ;
case wxWINDOW_VARIANT_SMALL :
themeFont = kCTFontSmallSystemFontType;
break ;
case wxWINDOW_VARIANT_MINI :
themeFont = kCTFontMiniSystemFontType;
break ;
case wxWINDOW_VARIANT_LARGE :
themeFont = kCTFontSystemFontType;
break ;
default:
wxFAIL_MSG(_T("unexpected window variant"));
break ;
}
font.MacCreateFromUIFont( themeFont ) ;
#endif
SetFont( font ) ; SetFont( font ) ;
#endif
} }
void wxWindowMac::MacUpdateControlFont() void wxWindowMac::MacUpdateControlFont()
@@ -782,17 +748,15 @@ void wxWindowMac::MacInvalidateBorders()
return ; return ;
int outerBorder = MacGetLeftBorderSize() ; int outerBorder = MacGetLeftBorderSize() ;
#if wxOSX_USE_CARBON
if ( m_peer->NeedsFocusRect() /* && m_peer->HasFocus() */ ) if ( m_peer->NeedsFocusRect() )
outerBorder += 4 ; outerBorder += 4 ;
#endif
if ( outerBorder == 0 ) if ( outerBorder == 0 )
return ; return ;
// now we know that we have something to do at all // now we know that we have something to do at all
int tx,ty,tw,th; int tx,ty,tw,th;
m_peer->GetSize( tw, th ); m_peer->GetSize( tw, th );