┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-09-30 23:22:56 +0200
committerPeter Penz <[email protected]>2011-09-30 23:27:09 +0200
commitd9f9e69ce1bdd6f898ee21cb2f14607bd90fa07b (patch)
tree3815617d32e78006a3f551c35665ad80420a3e08 /src/kitemviews/kitemlistview.cpp
parent7424fcc3314a63d0716cb428a8b8de24b23e0279 (diff)
Implement smooth-scrolling for horizontal and vertical scrollbars
Currently only a smoothscrolling was provided into the scroll-direction, but not in case of the details-view where a horizontal scrollbar might be shown too. Some minor adjustments of the private KItemListSmoothScroller interface will be done later...
Diffstat (limited to 'src/kitemviews/kitemlistview.cpp')
-rw-r--r--src/kitemviews/kitemlistview.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp
index 63315b665..f9c2fca18 100644
--- a/src/kitemviews/kitemlistview.cpp
+++ b/src/kitemviews/kitemlistview.cpp
@@ -119,7 +119,9 @@ void KItemListView::setScrollOrientation(Qt::Orientation orientation)
m_animation->setScrollOrientation(orientation);
m_sizeHintResolver->clearCache();
updateLayout();
+
onScrollOrientationChanged(orientation, previousOrientation);
+ emit scrollOrientationChanged(orientation, previousOrientation);
}
Qt::Orientation KItemListView::scrollOrientation() const
@@ -189,6 +191,13 @@ qreal KItemListView::maximumScrollOffset() const
void KItemListView::setItemOffset(qreal offset)
{
m_layouter->setItemOffset(offset);
+ if (m_header) {
+ m_header->setPos(-offset, 0);
+ }
+ if (!m_layoutTimer->isActive()) {
+ doLayout(NoAnimation, 0, 0);
+ update();
+ }
}
qreal KItemListView::itemOffset() const
@@ -1505,6 +1514,7 @@ void KItemListView::updateStretchedVisibleRolesSizes()
if (m_header) {
m_header->setVisibleRolesWidths(headerRolesWidths());
+ m_header->resize(dynamicItemSize.width(), m_header->size().height());
}
// Update the role sizes for all visible widgets