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
This commit is contained in:
Vadim Zeitlin 2008-09-26 17:36:35 +00:00
parent b5f85206a9
commit 3d9ecb8771

View File

@ -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);