on xenial help sign in
Fix items cut on top in the dash (or at least some instances of it)
9fdfeafAlbert Astals Cid
plugins/Dash/listviewwithpageheader.cpp−4
@@ -1392,10 +1392,6 @@ void ListViewWithPageHeader::updatePolish()
1392
1392
1393 m_contentHeightDirty = false;
1393 m_contentHeightDirty = false;
1394 adjustMinYExtent();
1394 adjustMinYExtent();
1395− if (contentHeight + m_minYExtent < height()) {
1396− // need this since in the previous call to adjustMinYExtent contentHeight is not set yet
1397− m_minYExtent = 0;
1398− }
1399 m_inContentHeightKeepHeaderShown = m_headerItem && m_headerItem->y() == contentY();
1395 m_inContentHeightKeepHeaderShown = m_headerItem && m_headerItem->y() == contentY();
1400 setContentHeight(contentHeight);
1396 setContentHeight(contentHeight);
1401 m_inContentHeightKeepHeaderShown = false;
1397 m_inContentHeightKeepHeaderShown = false;
tests/plugins/Dash/listviewwithpageheadertest.cpp+15
@@ -2008,6 +2008,21 @@ private Q_SLOTS:
2008 QTRY_COMPARE(lvwph->m_minYExtent, 610.);
2008 QTRY_COMPARE(lvwph->m_minYExtent, 610.);
2009 }
2009 }
2010
2010
2011+ void testRemoveItemCutContents()
2012+ {
2013+ view->rootObject()->setHeight(921);
2014+ QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 0), Q_ARG(QVariant, 6));
2015+ QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 0), Q_ARG(QVariant, 1000));
2016+ QTRY_COMPARE(lvwph->m_visibleItems.count(), 1);
2017+ scrollToBottom();
2018+ QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 0), Q_ARG(QVariant, 530));
2019+ QTRY_COMPARE(lvwph->m_visibleItems.count(), 2);
2020+ QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 1), Q_ARG(QVariant, 1));
2021+ QTRY_COMPARE(lvwph->m_visibleItems.count(), 1);
2022+ verifyItem(0, 50., 530., false);
2023+ QTRY_COMPARE(lvwph->m_minYExtent, 530.);
2024+ }
2025+
2011private:
2026private:
2012 QQuickView *view;
2027 QQuickView *view;
2013 ListViewWithPageHeader *lvwph;
2028 ListViewWithPageHeader *lvwph;