]> git.saurik.com Git - wxWidgets.git/commitdiff
Gave toolbars some extra height, Without which DoGetBestSize can report a size that's
authorJulian Smart <julian@anthemion.co.uk>
Thu, 9 Aug 2007 15:08:50 +0000 (15:08 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 9 Aug 2007 15:08:50 +0000 (15:08 +0000)
smaller than the actual window, causing windows to overlap slightly
in some circumstances, leading to missing borders. Removed a hack in AUI to
adjust for wrongly reported size.

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

src/aui/framemanager.cpp
src/msw/tbar95.cpp

index 0de88d573425c147de7d3fd1c9095fb97ec7be1f..93379c808761f993bb1cb651fa9b5adc476aca29 100644 (file)
@@ -923,7 +923,8 @@ bool wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info)
             // I believe this to be the correct action, until
             // wxToolBar::GetBestSize() is fixed.  Is this assumption
             // correct?
-            pinfo.best_size.y++;
+            // commented out by JACS 2007-9-08 after having added a pixel in wxMSW's wxToolBar::DoGetBestSize()
+            // pinfo.best_size.y++;
         }
 
         if (pinfo.min_size != wxDefaultSize)
index 54547adf94dd05eeacdf9ca3e7c4fec151bca5a3..86b92ac0350cc88252cb4df1d4255be216ebde40 100644 (file)
@@ -405,8 +405,16 @@ wxSize wxToolBar::DoGetBestSize() const
         sizeBest.y = size.cy;
     }
 
-    if (!IsVertical() && !(GetWindowStyle() & wxTB_NODIVIDER))
-        sizeBest.y += 1;
+    if (!IsVertical())
+    {
+        // Without the extra height, DoGetBestSize can report a size that's
+        // smaller than the actual window, causing windows to overlap slightly
+        // in some circumstances, leading to missing borders (especially noticeable
+        // in AUI layouts).
+        if (!(GetWindowStyle() & wxTB_NODIVIDER))
+            sizeBest.y += 2;
+        sizeBest.y ++;
+       }
 
     CacheBestSize(sizeBest);