summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-07-19 10:56:40 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-07-19 11:49:51 +0100
commit8ac3b0ddabc235dd5696cda4576d489b1c9a868c (patch)
tree04d9b7438776d0c8d2f8821af4733bf923ce19bb /vcl
parent6a0d53300c09a37a8524db72a97d49e1adf7b5c4 (diff)
minimize the scrollbar optimal size for the variable direction
Change-Id: Iae8647f5827bee1f0939d3da4e03b5312588bbfd
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/scrbar.cxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 1b39450baf27..fcb92e2a8a19 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