From d9f9e69ce1bdd6f898ee21cb2f14607bd90fa07b Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 30 Sep 2011 23:22:56 +0200 Subject: 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... --- src/kitemviews/kitemlistview.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/kitemviews/kitemlistview.cpp') 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 -- cgit v1.3