┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2011-08-13 14:34:17 +0200
committerFrank Reininghaus <[email protected]>2011-08-13 14:35:18 +0200
commitfabf5681f5ae71e7ad7cc1c4876917a31b9b40a6 (patch)
tree8c563c36b90ad68d6e00e412fd702664d12dddc3 /src/kitemviews
parent7230abb635e4f43db3d61821ed671486ee71d922 (diff)
KItemListContainer: show only the scroll bar that is needed
Up to now, KItemListContainer would show both a vertical and horizontal scroll bar after a view mode change. This commit fixes that by setting the maximum and the value of the scroll bar that is not needed to 0 in KItemListContainer::updateScrollBars().
Diffstat (limited to 'src/kitemviews')
-rw-r--r--src/kitemviews/kitemlistcontainer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/kitemviews/kitemlistcontainer.cpp b/src/kitemviews/kitemlistcontainer.cpp
index 906f44640..28e526a6f 100644
--- a/src/kitemviews/kitemlistcontainer.cpp
+++ b/src/kitemviews/kitemlistcontainer.cpp
@@ -232,14 +232,17 @@ void KItemListContainer::updateScrollBars()
QScrollBar* scrollBar = 0;
int singleStep = 0;
int pageStep = 0;
+ QScrollBar* otherScrollBar = 0;
if (view->scrollOrientation() == Qt::Vertical) {
scrollBar = verticalScrollBar();
singleStep = view->itemSize().height();
pageStep = view->size().height();
+ otherScrollBar = horizontalScrollBar();
} else {
scrollBar = horizontalScrollBar();
singleStep = view->itemSize().width();
pageStep = view->size().width();
+ otherScrollBar = verticalScrollBar();
}
const int value = view->offset();
@@ -263,6 +266,10 @@ void KItemListContainer::updateScrollBars()
scrollBar->setMinimum(0);
scrollBar->setMaximum(maximum);
scrollBar->setValue(value);
+
+ // Make sure that the other scroll bar is hidden
+ otherScrollBar->setMaximum(0);
+ otherScrollBar->setValue(0);
}
void KItemListContainer::updateGeometries()