on xenial help sign in
make list non interactive while on header animation
commitaa89d2765ee045b5d5f1f5b91a6ffb9afbad4461 authorAlbert Astals <albert.astals@canonical.com> dateMon 1 Sep 2014, 12:45 (12 years ago) parentf9648cc
2 files changed+8−5
plugins/Dash/listviewwithpageheader.cpp+7−4 plugins/Dash/listviewwithpageheader.h+1−1
plugins/Dash/listviewwithpageheader.cpp+7−4
@@ -172,7 +172,7 @@ ListViewWithPageHeader::ListViewWithPageHeader()
172172 connect(this, SIGNAL(contentWidthChanged()), this, SLOT(onContentWidthChanged()));
173173 connect(this, SIGNAL(contentHeightChanged()), this, SLOT(onContentHeightChanged()));
174174 connect(this, SIGNAL(heightChanged()), this, SLOT(onHeightChanged()));
175− connect(m_contentYAnimation, SIGNAL(stopped()), this, SLOT(onShowHeaderAnimationFinished()));
175+ connect(m_contentYAnimation, SIGNAL(runningChanged(bool)), this, SLOT(contentYAnimationRunningChanged(bool)));
176176
177177 setFlickableDirection(VerticalFlick);
178178}
@@ -1056,10 +1056,13 @@ void ListViewWithPageHeader::onModelUpdated(const QQmlChangeSet &changeSet, bool
10561056 m_contentHeightDirty = true;
10571057}
10581058
1059−void ListViewWithPageHeader::onShowHeaderAnimationFinished()
1059+void ListViewWithPageHeader::contentYAnimationRunningChanged(bool running)
10601060{
1061− m_contentHeightDirty = true;
1062− polish();
1061+ setInteractive(!running);
1062+ if (!running) {
1063+ m_contentHeightDirty = true;
1064+ polish();
1065+ }
10631066}
10641067
10651068void ListViewWithPageHeader::itemGeometryChanged(QQuickItem * /*item*/, const QRectF &newGeometry, const QRectF &oldGeometry)
plugins/Dash/listviewwithpageheader.h+1−1
@@ -118,7 +118,7 @@ private Q_SLOTS:
118118 void onContentWidthChanged();
119119 void onHeightChanged();
120120 void onModelUpdated(const QQmlChangeSet &changeSet, bool reset);
121− void onShowHeaderAnimationFinished();
121+ void contentYAnimationRunningChanged(bool running);
122122
123123private:
124124 class ListItem