From: Stefan Csomor Date: Tue, 1 Mar 2005 15:47:17 +0000 (+0000) Subject: correct placard under toolbar X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ddc548ec7796fd689dbc2eda7be08598d1dc885c correct placard under toolbar git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32534 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/toolbar.cpp b/src/mac/carbon/toolbar.cpp index 29ad6f810d..718123647d 100644 --- a/src/mac/carbon/toolbar.cpp +++ b/src/mac/carbon/toolbar.cpp @@ -690,12 +690,30 @@ bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *tool) void wxToolBar::OnPaint(wxPaintEvent& event) { wxPaintDC dc(this) ; -#if wxMAC_USE_CORE_GRAPHICS - // leave the background as it is (striped or metal) -#else - wxMacPortSetter helper(&dc) ; + int w, h ; GetSize( &w , &h ) ; +#if wxMAC_USE_CORE_GRAPHICS && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 + if ( !MacGetTopLevelWindow()->MacGetMetalAppearance() ) + { + if ( UMAGetSystemVersion() >= 0x1030 ) + { + HIThemePlacardDrawInfo info ; + memset( &info, 0 , sizeof( info ) ) ; + info.version = 0 ; + info.state = IsEnabled() ? kThemeStateActive : kThemeStateInactive ; + + CGContextRef cgContext = (CGContextRef) MacGetCGContextRef() ; + HIRect rect = CGRectMake( 0 , 0 , w , h ) ; + HIThemeDrawPlacard( &rect , & info , cgContext, kHIThemeOrientationNormal) ; + } + } + else + { + // leave the background as it is (striped or metal) + } +#else + wxMacPortSetter helper(&dc) ; Rect toolbarrect = { dc.YLOG2DEVMAC(0) , dc.XLOG2DEVMAC(0) , dc.YLOG2DEVMAC(h) , dc.XLOG2DEVMAC(w) } ;