X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bd83cb56d29385e2a87840eeb3876b976a5afc43..4a82abc831c7e2cf6e0d46776473f22e7469b536:/src/common/wincmn.cpp?ds=sidebyside

diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp
index c419076210..ca0f43b5f9 100644
--- a/src/common/wincmn.cpp
+++ b/src/common/wincmn.cpp
@@ -162,6 +162,9 @@ void wxWindowBase::InitBase()
 #if wxUSE_CARET
     m_caret = (wxCaret *)NULL;
 #endif // wxUSE_CARET
+
+    // Whether we're using the current theme for this window (wxGTK only for now)
+    m_themeEnabled = FALSE;
 }
 
 // common part of window creation process
@@ -399,7 +402,14 @@ void wxWindowBase::Fit()
 {
     if ( GetChildren().GetCount() > 0 )
     {
-        SetClientSize(DoGetBestSize());
+        wxSize size = DoGetBestSize();
+
+        // for compatibility with the old versions and because it really looks
+        // slightly more pretty like this, add a pad
+        size.x += 7;
+        size.y += 14;
+
+        SetClientSize(size);
     }
     //else: do nothing if we have no children
 }
@@ -418,7 +428,7 @@ wxSize wxWindowBase::DoGetBestSize() const
               node = node->GetNext() )
         {
             wxWindow *win = node->GetData();
-            if ( win->IsTopLevel() || wxDynamicCast(win, wxStatusBar) )
+            if ( win->IsTopLevel() || wxDynamicCast(win, wxStatusBar) || !win->IsShown())
             {
                 // dialogs and frames lie in different top level windows -
                 // don't deal with them here; as for the status bars, they
@@ -443,8 +453,7 @@ wxSize wxWindowBase::DoGetBestSize() const
                 maxY = wy + wh;
         }
 
-        // leave a margin
-        return wxSize(maxX + 7, maxY + 14);
+        return wxSize(maxX, maxY);
     }
     else
     {