From: Vadim Zeitlin Date: Sun, 11 Sep 2011 11:27:17 +0000 (+0000) Subject: Still resize wxSplitterWindow children even when sash position doesn't change. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e657c460a39fdc22b5f71a77a224f274e681e393?ds=inline Still resize wxSplitterWindow children even when sash position doesn't change. Since the changes if r68876, the splitter windows were not resized correctly if the splitter size in the direction orthogonal to its own didn't change. This was an unintended side effect of the changes in that commit as it only wanted to avoid calling SetSashPositionAndNotify() in this case, but SizeWindows() should still be called. Ensure that we do call it always from wxSplitterWindow::OnSize() to fix this. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index ab5285ba34..968c1a1d58 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -445,21 +445,21 @@ void wxSplitterWindow::OnSize(wxSizeEvent& event) // out of current range in this case as otherwise the really requested // position would be lost and never set. Wait until we get a real size // event with our non-initial size to do it. - if ( size == old_size ) - return; - - int delta = (int) ( (size - old_size)*m_sashGravity ); - if ( delta != 0 ) + if ( size != old_size ) { - int newPosition = m_sashPosition + delta; - if( newPosition < m_minimumPaneSize ) - newPosition = m_minimumPaneSize; - SetSashPositionAndNotify(newPosition); - } + int delta = (int) ( (size - old_size)*m_sashGravity ); + if ( delta != 0 ) + { + int newPosition = m_sashPosition + delta; + if( newPosition < m_minimumPaneSize ) + newPosition = m_minimumPaneSize; + SetSashPositionAndNotify(newPosition); + } - if ( m_sashPosition >= size - 5 ) - SetSashPositionAndNotify(wxMax(10, size - 40)); - m_lastSize = wxSize(w,h); + if ( m_sashPosition >= size - 5 ) + SetSashPositionAndNotify(wxMax(10, size - 40)); + m_lastSize = wxSize(w,h); + } } SizeWindows();