From: Peter Penz Date: Mon, 26 Dec 2011 21:28:54 +0000 (+0100) Subject: Improve item offset scrolling X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/c33c54be7d07cf9470205f867fbf98a32dfe8ef7 Improve item offset scrolling Don't check whether the m_layoutTimer is active: Changing the item offset must always trigger a synchronous layout, otherwise the smooth-scrolling might get jerky. --- diff --git a/src/kitemviews/kitemlistview.cpp b/src/kitemviews/kitemlistview.cpp index be03606ce..5dbc128b5 100644 --- a/src/kitemviews/kitemlistview.cpp +++ b/src/kitemviews/kitemlistview.cpp @@ -201,13 +201,19 @@ qreal KItemListView::maximumScrollOffset() const void KItemListView::setItemOffset(qreal offset) { + if (m_layouter->itemOffset() == offset) { + return; + } + m_layouter->setItemOffset(offset); if (m_header) { m_header->setPos(-offset, 0); } - if (!m_layoutTimer->isActive()) { - doLayout(NoAnimation); - } + + // Don't check whether the m_layoutTimer is active: Changing the + // item offset must always trigger a synchronous layout, otherwise + // the smooth-scrolling might get jerky. + doLayout(NoAnimation); } qreal KItemListView::itemOffset() const