summaryrefslogtreecommitdiffstats
path: root/sfx2
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2012-08-18 11:36:24 -0430
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-08-20 06:40:47 +0200
commitbd4f4acd998fae07695a82ae26bfea19a4adfae0 (patch)
tree07db5ab583aa2457fede5ac69b5f26d2de5846e5 /sfx2
parentFix filtering items in thumbnailview when painting. (diff)
downloadcore-bd4f4acd998fae07695a82ae26bfea19a4adfae0.tar.gz
core-bd4f4acd998fae07695a82ae26bfea19a4adfae0.zip
Set correct scrollbar size depending on the item count of the view.
Change-Id: Ic659f8c3616f43d0e4dd5b4fcc6ec02474c36818
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/thumbnailview.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index 996e458eeca9..b589ea947a4a 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -395,18 +395,20 @@ void ThumbnailView::CalculateItemPositions ()
// arrange ScrollBar, set values and show it
if ( mpScrBar )
{
+ long nLines = (nCurCount+mnCols-1)/mnCols;
+
Point aPos( aWinSize.Width() - nScrBarWidth - mnScrBarOffset, mnHeaderHeight );
Size aSize( nScrBarWidth - mnScrBarOffset, aWinSize.Height() - mnHeaderHeight );
mpScrBar->SetPosSizePixel( aPos, aSize );
- mpScrBar->SetRangeMax( mnLines );
+ mpScrBar->SetRangeMax( (nCurCount+mnCols-1)/mnCols);
mpScrBar->SetVisibleSize( mnVisLines );
mpScrBar->SetThumbPos( (long)mnFirstLine );
long nPageSize = mnVisLines;
if ( nPageSize < 1 )
nPageSize = 1;
mpScrBar->SetPageSize( nPageSize );
- mpScrBar->Show(mbScroll);
+ mpScrBar->Show( nLines > mnVisLines );
}
// delete ScrollBar
@@ -1201,6 +1203,7 @@ void ThumbnailView::setSelectionMode (bool mode)
void ThumbnailView::filterItems (const boost::function<bool (const ThumbnailViewItem*) > &func)
{
+ mnFirstLine = 0; // start at the top of the list instead of the current position
maFilterFunc = func;
CalculateItemPositions();