From 1b5dfa53aa2c3ddf779332ca5b1b5bd29f725a84 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 30 Oct 2011 19:48:48 +0000 Subject: [PATCH] Fix the check for second window becoming too small in wxSplitterWindow. There was a strange check for the second pane size in OnSize() which hardcoded 5 pixels as minimal pane size in the check and 40 pixels as the minimal size to set. This resulted in strange behaviour when the second pane size would decrease to 6 pixels smoothly and then jump back to 40 pixels when the splitter window was resized and also was ugly at the code level. Get rid of this code and simply call AdjustSashPosition() to ensure that the sash position remains valid as the splitter is resized. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69600 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/splitter.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index 8c03ba8ebd..f4a4107e30 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -461,9 +461,10 @@ void wxSplitterWindow::OnSize(wxSizeEvent& event) SetSashPositionAndNotify(newPosition); } - if ( m_sashPosition >= size - 5 ) - SetSashPositionAndNotify(wxMax(10, size - 40)); - m_lastSize = wxSize(w,h); + // Also check if the second window became too small. + int adjustedPosition = AdjustSashPosition(m_sashPosition); + if ( adjustedPosition != m_sashPosition ) + SetSashPositionAndNotify(adjustedPosition); } } -- 2.47.2