[Libreoffice-commits] core.git: vcl/source

Caolán McNamara caolanm at redhat.com
Fri Jul 19 03:50:13 PDT 2013


 vcl/source/control/scrbar.cxx |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 8ac3b0ddabc235dd5696cda4576d489b1c9a868c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jul 19 10:56:40 2013 +0100

    minimize the scrollbar optimal size for the variable direction
    
    Change-Id: Iae8647f5827bee1f0939d3da4e03b5312588bbfd

diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 1b39450..fcb92e2 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -1455,7 +1455,21 @@ Size ScrollBar::GetOptimalSize() const
 {
     if (mbCalcSize)
         const_cast<ScrollBar*>(this)->ImplCalc(sal_False);
-    return getCurrentCalcSize();
+
+    Size aRet = getCurrentCalcSize();
+
+    const long nMinThumbSize = GetSettings().GetStyleSettings().GetMinThumbSize();
+
+    if (GetStyle() & WB_HORZ)
+    {
+        aRet.Width() = maBtn1Rect.GetWidth() + nMinThumbSize + maBtn2Rect.GetWidth();
+    }
+    else
+    {
+        aRet.Height() = maBtn1Rect.GetHeight() + nMinThumbSize + maBtn2Rect.GetHeight();
+    }
+
+    return aRet;
 }
 
 Size ScrollBar::getCurrentCalcSize() const


More information about the Libreoffice-commits mailing list