on xenial help sign in
Only enable the animation when the item is on screen (i.e. !culled)
commit4e4dafa8df93a92626638a61ce45f7abf6a1d234 authorAlbert Astals <albert.astals@canonical.com> dateTue 1 Oct 2013, 11:37 (13 years ago) parentbfc301c
2 files changed+8−1
Dash/Apps/RunningApplicationsGrid.qml+4−1 plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+4
Dash/Apps/RunningApplicationsGrid.qml+4−1
@@ -29,7 +29,10 @@ ResponsiveFlowView {
2929 onStageScreenshotsReadyChanged: if (shell.dashShown && shell.stageScreenshotsReady) updateScreenshots();
3030 }
3131
32− Behavior on height { NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } }
32+ Behavior on height {
33+ enabled: culled === 'undefined' || !culled;
34+ NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
35+ }
3336
3437 property bool canEnableTerminationMode: true
3538
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+4
@@ -139,6 +139,9 @@ void ListViewWithPageHeader::ListItem::setCulled(bool culled)
139139 QQuickItemPrivate::get(m_item)->setCulled(culled);
140140 if (m_sectionItem)
141141 QQuickItemPrivate::get(m_sectionItem)->setCulled(culled);
142+
143+ QQmlContext *itemContext = QQmlEngine::contextForObject(m_item)->parentContext();
144+ itemContext->setContextProperty(QLatin1String("culled"), QVariant::fromValue<bool>(culled));
142145}
143146
144147ListViewWithPageHeader::ListViewWithPageHeader()
@@ -849,6 +852,7 @@ void ListViewWithPageHeader::itemCreated(int modelIndex, QObject *object)
849852 QQmlContext *context = QQmlEngine::contextForObject(item)->parentContext();
850853 context->setContextProperty(QLatin1String("ListViewWithPageHeader"), this);
851854 context->setContextProperty(QLatin1String("heightToClip"), QVariant::fromValue<int>(0));
855+ context->setContextProperty(QLatin1String("culled"), QVariant::fromValue<bool>(false));
852856 if (modelIndex == m_asyncRequestedIndex) {
853857 createItem(modelIndex, false);
854858 refill();