]> git.saurik.com Git - wxWidgets.git/commitdiff
If the window has a minsize then use that as the BestSize if there is
authorRobin Dunn <robin@alldunn.com>
Thu, 15 Apr 2004 23:21:35 +0000 (23:21 +0000)
committerRobin Dunn <robin@alldunn.com>
Thu, 15 Apr 2004 23:21:35 +0000 (23:21 +0000)
no sizer, contstraints, or children, otherwise use current size as before.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26826 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/wincmn.cpp

index 0c419c047695c51db57f18ee1f348dea6ee4439f..6b6b35ab28ef78aa878c10b1df26ecef889a161d 100644 (file)
@@ -589,11 +589,14 @@ wxSize wxWindowBase::DoGetBestSize() const
 
         return wxSize(maxX, maxY);
     }
-    else // has children
+    else // has children
     {
-        // for a generic window there is no natural best size - just use the
-        // current size
-        return GetSize();
+        // for a generic window there is no natural best size - just use either the
+        // minimum size if there is one, or the current size
+        if ( GetMinSize().IsFullySpecified() )
+            return GetMinSize();
+        else
+            return GetSize();
     }
 }