on xenial help sign in
Bring back force non clip for previews
5af755cAlbert Astals
Dash/DashPeople.qml+1−1
@@ -93,7 +93,7 @@ LensView {
93 model: lensView.categories
93 model: lensView.categories
94 onAtYEndChanged: if (atYEnd) endReached()
94 onAtYEndChanged: if (atYEnd) endReached()
95 onMovingChanged: if (moving && atYEnd) endReached()
95 onMovingChanged: if (moving && atYEnd) endReached()
96− // clipListView: !previewLoader.onScreen
96+ forceNoClip: previewLoader.onScreen
97
97
98 delegate: ListItems.Base {
98 delegate: ListItems.Base {
99 id: base
99 id: base
Dash/DashVideos.qml+1−1
@@ -102,7 +102,7 @@ LensView {
102 id: categoryView
102 id: categoryView
103 anchors.fill: parent
103 anchors.fill: parent
104 model: lensView.categories
104 model: lensView.categories
105−// clipListView: !previewLoader.onScreen
105+ forceNoClip: previewLoader.onScreen
106
106
107 onAtYEndChanged: if (atYEnd) endReached()
107 onAtYEndChanged: if (atYEnd) endReached()
108 onMovingChanged: if (moving && atYEnd) endReached()
108 onMovingChanged: if (moving && atYEnd) endReached()
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+16−1
@@ -68,6 +68,7 @@ ListViewWithPageHeader::ListViewWithPageHeader()
68 , m_headerItemShownHeight(0)
68 , m_headerItemShownHeight(0)
69 , m_sectionDelegate(nullptr)
69 , m_sectionDelegate(nullptr)
70 , m_topSectionItem(nullptr)
70 , m_topSectionItem(nullptr)
71+ , m_forceNoClip(false)
71{
72{
72 m_clipItem = new QQuickItem(contentItem());
73 m_clipItem = new QQuickItem(contentItem());
73// m_clipItem = new QQuickRectangle(contentItem());
74// m_clipItem = new QQuickRectangle(contentItem());
@@ -210,6 +211,20 @@ void ListViewWithPageHeader::setSectionProperty(const QString &property)
210 }
211 }
211}
212}
212
213
214+bool ListViewWithPageHeader::forceNoClip() const
215+{
216+ return m_forceNoClip;
217+}
218+
219+void ListViewWithPageHeader::setForceNoClip(bool noClip)
220+{
221+ if (noClip != m_forceNoClip) {
222+ m_forceNoClip = noClip;
223+ updateClipItem();
224+ Q_EMIT forceNoClipChanged();
225+ }
226+}
227+
213void ListViewWithPageHeader::positionAtBeginning()
228void ListViewWithPageHeader::positionAtBeginning()
214{
229{
215 qreal headerHeight = (m_headerItem ? m_headerItem->height() : 0);
230 qreal headerHeight = (m_headerItem ? m_headerItem->height() : 0);
@@ -550,7 +565,7 @@ void ListViewWithPageHeader::updateClipItem()
550{
565{
551 m_clipItem->setHeight(height() - m_headerItemShownHeight);
566 m_clipItem->setHeight(height() - m_headerItemShownHeight);
552 m_clipItem->setY(contentY() + m_headerItemShownHeight);
567 m_clipItem->setY(contentY() + m_headerItemShownHeight);
553− m_clipItem->setClip(m_headerItemShownHeight > 0);
568+ m_clipItem->setClip(!m_forceNoClip && m_headerItemShownHeight > 0);
554}
569}
555
570
556void ListViewWithPageHeader::onContentHeightChanged()
571void ListViewWithPageHeader::onContentHeightChanged()
plugins/ListViewWithPageHeader/listviewwithpageheader.h+7
@@ -33,6 +33,7 @@ class ListViewWithPageHeader : public QQuickFlickable, public QQuickItemChangeLi
33 Q_PROPERTY(QQuickItem *pageHeader READ header WRITE setHeader NOTIFY headerChanged)
33 Q_PROPERTY(QQuickItem *pageHeader READ header WRITE setHeader NOTIFY headerChanged)
34 Q_PROPERTY(QQmlComponent *sectionDelegate READ sectionDelegate WRITE setSectionDelegate NOTIFY sectionDelegateChanged)
34 Q_PROPERTY(QQmlComponent *sectionDelegate READ sectionDelegate WRITE setSectionDelegate NOTIFY sectionDelegateChanged)
35 Q_PROPERTY(QString sectionProperty READ sectionProperty WRITE setSectionProperty NOTIFY sectionPropertyChanged)
35 Q_PROPERTY(QString sectionProperty READ sectionProperty WRITE setSectionProperty NOTIFY sectionPropertyChanged)
36+ Q_PROPERTY(bool forceNoClip READ forceNoClip WRITE setForceNoClip NOTIFY forceNoClipChanged)
36
37
37 friend class ListViewWithPageHeaderTest;
38 friend class ListViewWithPageHeaderTest;
38
39
@@ -55,6 +56,9 @@ public:
55 QString sectionProperty() const;
56 QString sectionProperty() const;
56 void setSectionProperty(const QString &property);
57 void setSectionProperty(const QString &property);
57
58
59+ bool forceNoClip() const;
60+ void setForceNoClip(bool noClip);
61+
58 Q_INVOKABLE void positionAtBeginning();
62 Q_INVOKABLE void positionAtBeginning();
59 Q_INVOKABLE void showHeader();
63 Q_INVOKABLE void showHeader();
60
64
@@ -64,6 +68,7 @@ Q_SIGNALS:
64 void headerChanged();
68 void headerChanged();
65 void sectionDelegateChanged();
69 void sectionDelegateChanged();
66 void sectionPropertyChanged();
70 void sectionPropertyChanged();
71+ void forceNoClipChanged();
67
72
68protected:
73protected:
69 void componentComplete();
74 void componentComplete();
@@ -140,6 +145,8 @@ private:
140 QQmlComponent *m_sectionDelegate;
145 QQmlComponent *m_sectionDelegate;
141 QString m_sectionProperty;
146 QString m_sectionProperty;
142 QQuickItem *m_topSectionItem;
147 QQuickItem *m_topSectionItem;
148+
149+ bool m_forceNoClip;
143};
150};
144
151
145
152