]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/scrolwin.cpp
no changes, just added a TODO comment
[wxWidgets.git] / src / gtk / scrolwin.cpp
index 7519c5c58961b4a9cbd0a0742bb3a430c2b8edb1..2f9bc568fa66cc6bedc1a9d6da3383a138c91040 100644 (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);