┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-12-26 22:28:54 +0100
committerPeter Penz <[email protected]>2011-12-26 22:30:15 +0100
commit2e2a6ae24c7c34fbed3f81b281f1ee19e95350f5 (patch)
treefe5070ddaed2333276324a221c1b9da83ab8a79e /src/kitemviews/kitemlistview.cpp
parent118fe89449a6e94065a0b30748f4f854b2fbeb27 (diff)
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.
Diffstat (limited to 'src/kitemviews/kitemlistview.cpp')
-rw-r--r--src/kitemviews/kitemlistview.cpp12
1 files changed, 9 insertions, 3 deletions
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