diff options
| author | Peter Penz <[email protected]> | 2011-12-26 22:28:54 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-12-26 22:30:15 +0100 |
| commit | 2e2a6ae24c7c34fbed3f81b281f1ee19e95350f5 (patch) | |
| tree | fe5070ddaed2333276324a221c1b9da83ab8a79e /src/kitemviews/kitemlistview.cpp | |
| parent | 118fe89449a6e94065a0b30748f4f854b2fbeb27 (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.cpp | 12 |
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 |
