on xenial help sign in
Calculate heightToClip correctly for non first items of a section chain
commit5602cfa2fc6cd2259f24bb70fe2d75b162092bc6 authorAlbert Astals <albert.astals@canonical.com> dateThu 27 Jun 2013, 10:47 (13 years ago) parent9f40510
1 file changed+3−2
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+3−2
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+3−2
@@ -967,8 +967,9 @@ void ListViewWithPageHeader::layout()
967967 }
968968 }
969969 QQmlContext *context = QQmlEngine::contextForObject(item->m_item)->parentContext();
970− if (!cull && pos < visibleFrom) {
971− context->setContextProperty(QLatin1String("heightToClip"), visibleFrom - pos);
970+ const qreal clipFrom = visibleFrom + (!item->m_sectionItem && m_topSectionItem && !QQuickItemPrivate::get(m_topSectionItem)->culled ? m_topSectionItem->height() : 0);
971+ if (!cull && pos < clipFrom) {
972+ context->setContextProperty(QLatin1String("heightToClip"), clipFrom - pos);
972973 } else {
973974 context->setContextProperty(QLatin1String("heightToClip"), QVariant::fromValue<int>(0));
974975 }