]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/toolbar.cpp
Use empty check consistent with other parts.
[wxWidgets.git] / src / mac / carbon / toolbar.cpp
index 5c6aedcb0ef290ac3c59bf290fb80cbfec33efbf..718123647d8a6c254eb224e1293507e9fa61a475 100644 (file)
@@ -247,7 +247,6 @@ void wxToolBarTool::SetPosition(const wxPoint& position)
 
     if ( ! GetToolBar()->MacGetTopLevelWindow()->MacUsesCompositing() )
     {
-        WindowRef rootwindow = (WindowRef) GetToolBar()->MacGetTopLevelWindowRef() ;    
         GetToolBar()->MacWindowToRootWindow( &x , &y ) ;
         mac_x += x;
         mac_y += y;
@@ -691,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) } ;