From 3d9ecb8771f553bbabbb368cb808c83c8e9cc90b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 26 Sep 2008 17:36:35 +0000 Subject: [PATCH] eliminate the hysteresis when scrollbars didn't disappear when the window was resized to be less than its virtual size and then resized back to be slightly greater than it in the native GTK version too git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/scrolwin.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/gtk/scrolwin.cpp b/src/gtk/scrolwin.cpp index 7519c5c589..2f9bc568fa 100644 --- a/src/gtk/scrolwin.cpp +++ b/src/gtk/scrolwin.cpp @@ -122,13 +122,26 @@ void wxScrollHelperNative::DoAdjustScrollbar(GtkRange* range, void wxScrollHelperNative::AdjustScrollbars() { int vw, vh; - m_targetWindow->GetVirtualSize( &vw, &vh ); + m_targetWindow->GetVirtualSize(&vw, &vh); + + int w, h; + const wxSize availSize = GetSizeAvailableForScrollTarget( + m_win->GetSize() - m_win->GetWindowBorderSize()); + if ( availSize.x >= vw && availSize.y >= vh ) + { + w = availSize.x; + h = availSize.y; + + // we know that the scrollbars will be removed + DoAdjustHScrollbar(w, vw); + DoAdjustVScrollbar(h, vh); + + return; + } - int w; m_targetWindow->GetClientSize(&w, NULL); DoAdjustHScrollbar(w, vw); - int h; m_targetWindow->GetClientSize(NULL, &h); DoAdjustVScrollbar(h, vh); -- 2.45.2