on xenial help sign in
Don't remove items when overshooting
0a59ac8Albert Astals
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+7
@@ -587,6 +587,13 @@ QQuickItem *ListViewWithPageHeader::getSectionItem(const QString &sectionText)
587bool ListViewWithPageHeader::removeNonVisibleItems(qreal bufferFrom, qreal bufferTo)
587bool ListViewWithPageHeader::removeNonVisibleItems(qreal bufferFrom, qreal bufferTo)
588{
588{
589// qDebug() << "ListViewWithPageHeader::removeNonVisibleItems" << bufferFrom << bufferTo;
589// 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+ }
590 bool changed = false;
597 bool changed = false;
591
598
592 bool foundVisible = false;
599 bool foundVisible = false;