on xenial help sign in
Only enable the animation when the item is on screen (i.e. !culled)
301e6adAlbert Astals
Dash/Apps/RunningApplicationsGrid.qml+5−1
@@ -29,7 +29,11 @@ ResponsiveFlowView {
29 onStageScreenshotsReadyChanged: if (shell.dashShown && shell.stageScreenshotsReady) updateScreenshots();
29 onStageScreenshotsReadyChanged: if (shell.dashShown && shell.stageScreenshotsReady) updateScreenshots();
30 }
30 }
31
31
32+ Behavior on height {
33+ // FIXME Rethink how we pass down properties from the LVWPH to the interested parties
34+ enabled: culled === undefined || !culled;
32− Behavior on height { NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } }
35+ NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
36+ }
33
37
34 property bool canEnableTerminationMode: true
38 property bool canEnableTerminationMode: true
35
39
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+4
@@ -139,6 +139,9 @@ void ListViewWithPageHeader::ListItem::setCulled(bool culled)
139 QQuickItemPrivate::get(m_item)->setCulled(culled);
139 QQuickItemPrivate::get(m_item)->setCulled(culled);
140 if (m_sectionItem)
140 if (m_sectionItem)
141 QQuickItemPrivate::get(m_sectionItem)->setCulled(culled);
141 QQuickItemPrivate::get(m_sectionItem)->setCulled(culled);
142+
143+ QQmlContext *itemContext = QQmlEngine::contextForObject(m_item)->parentContext();
144+ itemContext->setContextProperty(QLatin1String("culled"), QVariant::fromValue<bool>(culled));
142}
145}
143
146
144ListViewWithPageHeader::ListViewWithPageHeader()
147ListViewWithPageHeader::ListViewWithPageHeader()
@@ -849,6 +852,7 @@ void ListViewWithPageHeader::itemCreated(int modelIndex, QObject *object)
849 QQmlContext *context = QQmlEngine::contextForObject(item)->parentContext();
852 QQmlContext *context = QQmlEngine::contextForObject(item)->parentContext();
850 context->setContextProperty(QLatin1String("ListViewWithPageHeader"), this);
853 context->setContextProperty(QLatin1String("ListViewWithPageHeader"), this);
851 context->setContextProperty(QLatin1String("heightToClip"), QVariant::fromValue<int>(0));
854 context->setContextProperty(QLatin1String("heightToClip"), QVariant::fromValue<int>(0));
855+ context->setContextProperty(QLatin1String("culled"), QVariant::fromValue<bool>(false));
852 if (modelIndex == m_asyncRequestedIndex) {
856 if (modelIndex == m_asyncRequestedIndex) {
853 createItem(modelIndex, false);
857 createItem(modelIndex, false);
854 refill();
858 refill();