on xenial help sign in
Better to update the minyextent often
commitcb4594365e6be2db2bc226b09457b99a8b693299 authorAlbert Astals <albert.astals@canonical.com> dateTue 5 Nov 2013, 10:42 (13 years ago) parent5c8f2ef
1 file changed+2−3
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+2−3
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+2−3
@@ -476,7 +476,7 @@ void ListViewWithPageHeader::viewportMoved(Qt::Orientations orient)
476476 qreal diff = m_previousContentY - contentY();
477477 const bool showHeaderAnimationRunning = m_contentYAnimation->isRunning() && contentYAnimationType == ContentYAnimationShowHeader;
478478 if (m_headerItem) {
479− auto oldHeaderItemShownHeight = m_headerItemShownHeight;
479+ const auto oldHeaderItemShownHeight = m_headerItemShownHeight;
480480 if (contentY() < -m_minYExtent) {
481481 // Stick the header item to the top when dragging down
482482 m_headerItem->setY(contentY());
@@ -980,7 +980,6 @@ void ListViewWithPageHeader::onModelUpdated(const QQmlChangeSet &changeSet, bool
980980 if (growUp) {
981981 ListItem *firstItem = m_visibleItems.first();
982982 firstItem->setY(firstItem->y() - item->height());
983− adjustMinYExtent();
984983 }
985984 // Adding an item may break a "same section" chain, so check
986985 // if we need adding a new section item
@@ -991,7 +990,6 @@ void ListViewWithPageHeader::onModelUpdated(const QQmlChangeSet &changeSet, bool
991990 if (growUp && nextItem->m_sectionItem) {
992991 ListItem *firstItem = m_visibleItems.first();
993992 firstItem->setY(firstItem->y() - nextItem->m_sectionItem->height());
994− adjustMinYExtent();
995993 }
996994 }
997995 }
@@ -1000,6 +998,7 @@ void ListViewWithPageHeader::onModelUpdated(const QQmlChangeSet &changeSet, bool
1000998 ListItem *firstItem = m_visibleItems.first();
1001999 firstItem->setY(oldFirstValidIndexPos);
10021000 }
1001+ adjustMinYExtent();
10031002 } else if (insert.index <= m_firstVisibleIndex) {
10041003 m_firstVisibleIndex += insert.count;
10051004 }