on xenial help sign in
Only enable the animation when the item is on screen (i.e. !culled)

. Fixes: https://bugs.launchpad.net/bugs/1200374. Approved by PS Jenkins bot, Michał Sawicz.

commit301e6adc115ed77c519433bb9d3122aaeb2beefc authorAlbert Astals <albert.astals@canonical.com> dateWed 2 Oct 2013, 06:35 (13 years ago) parentf33b102e2b8b01
2 files changed+9−1
Dash/Apps/RunningApplicationsGrid.qml+5−1 plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+4
Dash/Apps/RunningApplicationsGrid.qml+5−1
@@ -29,7 +29,11 @@ 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+ // FIXME Rethink how we pass down properties from the LVWPH to the interested parties
34+ enabled: culled === undefined || !culled;
35+ NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
36+ }
3337
3438 property bool canEnableTerminationMode: true
3539
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();