From c118d8b06e867235a050add7cf89564923de3387 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 9 Aug 2007 15:08:50 +0000 Subject: [PATCH] Gave toolbars some extra height, Without which DoGetBestSize can report a size that's 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 | 3 ++- src/msw/tbar95.cpp | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index 0de88d5734..93379c8087 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -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) diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 54547adf94..86b92ac035 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -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); -- 2.47.2