]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/splitter.cpp
Disable some wxWebView tests that fail on the buildbot but not locally.
[wxWidgets.git] / src / generic / splitter.cpp
index 8c03ba8ebd02c85e19be0f82bc839f9e435fee0c..dee38940afa59a628e0a1f3a121fc6f23b55e712 100644 (file)
@@ -451,19 +451,23 @@ void wxSplitterWindow::OnSize(wxSizeEvent& event)
         // Don't do anything if the size didn't really change.
         if ( size != old_size )
         {
+            int newPosition = -1;
+
             // Apply gravity if we use it.
             int delta = (int) ( (size - old_size)*m_sashGravity );
             if ( delta != 0 )
             {
-                int newPosition = m_sashPosition + delta;
+                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);
+            // Also check if the second window became too small.
+            newPosition = AdjustSashPosition(newPosition == -1
+                                                 ? m_sashPosition
+                                                 : newPosition);
+            if ( newPosition != m_sashPosition )
+                SetSashPositionAndNotify(newPosition);
         }
     }