]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/toplevel.cpp
bitmap button size was too small when uxtheme functions were used to get the margins
[wxWidgets.git] / src / mac / carbon / toplevel.cpp
index 38bee34358a026576ee401962e9c51162af5fd7f..7c57eeed8674219a20f34283ca8df94ba120c0b6 100644 (file)
     #pragma hdrstop
 #endif
 
+#include "wx/toplevel.h"
+
 #ifndef WX_PRECOMP
     #include "wx/app.h"
-    #include "wx/toplevel.h"
     #include "wx/frame.h"
     #include "wx/string.h"
     #include "wx/log.h"
@@ -994,7 +995,7 @@ void wxTopLevelWindowMac::Maximize(bool maximize)
     wxMacPortStateHelper help( (GrafPtr)GetWindowPort( (WindowRef)m_macWindow) ) ;
     wxMacWindowClipper clip( this );
 #endif
-
+#if 0
     if ( !IsWindowInStandardState( (WindowRef)m_macWindow, NULL, NULL ) )
     {
         Rect rect;
@@ -1003,8 +1004,18 @@ void wxTopLevelWindowMac::Maximize(bool maximize)
         SetWindowIdealUserState((WindowRef)m_macWindow, &rect);
         SetWindowUserState((WindowRef)m_macWindow, &rect);
     }
-
     ZoomWindow( (WindowRef)m_macWindow , maximize ? inZoomOut : inZoomIn , false ) ;
+#else
+    Point idealSize = { 0 , 0 } ;
+    if ( maximize )
+    {
+        Rect rect ;
+        GetAvailableWindowPositioningBounds(GetMainDevice(),&rect) ;
+        idealSize.h = rect.right - rect.left ;
+        idealSize.v = rect.bottom - rect.top ;
+    }
+    ZoomWindowIdeal( (WindowRef)m_macWindow , maximize ? inZoomOut : inZoomIn , &idealSize ) ;
+#endif
 }
 
 bool wxTopLevelWindowMac::IsMaximized() const