on xenial help sign in
Don't remove items when overshooting
commit0a59ac8707cd9a5177c91f91c025e24754186886 authorAlbert Astals <albert.astals@canonical.com> dateWed 26 Jun 2013, 11:24 (13 years ago) parentd22667e
1 file changed+7
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+7
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+7
@@ -587,6 +587,13 @@ QQuickItem *ListViewWithPageHeader::getSectionItem(const QString &sectionText)
587587bool ListViewWithPageHeader::removeNonVisibleItems(qreal bufferFrom, qreal bufferTo)
588588{
589589// qDebug() << "ListViewWithPageHeader::removeNonVisibleItems" << bufferFrom << bufferTo;
590+ // Do not remove items if we are overshooting up or down, since we'll come back
591+ // to the "stable" position and delete/create items without any reason
592+ if (contentY() < -m_minYExtent) {
593+ return false;
594+ } else if (contentY() + height() > contentHeight()) {
595+ return false;
596+ }
590597 bool changed = false;
591598
592599 bool foundVisible = false;