on xenial help sign in
Fix items cut on top in the dash (or at least some instances of it)

This reverts a workaround for tests failing introduced in r2121 The commit log of that revision says "The other solutions involve implementing maxYExtent" which we actually implemented in r2351 so the workaround would not seem needed anymore and on top of it is causing brokenness so remove it

commit9fdfeaf8acf1f72326775473fe5065c469df2116 authorAlbert Astals Cid <albert.astals@canonical.com> dateThu 4 Aug 2016, 17:16 (10 years ago) parent67c0fdb
2 files changed+15−4
plugins/Dash/listviewwithpageheader.cpp−4 tests/plugins/Dash/listviewwithpageheadertest.cpp+15
plugins/Dash/listviewwithpageheader.cpp−4
@@ -1392,10 +1392,6 @@ void ListViewWithPageHeader::updatePolish()
13921392
13931393 m_contentHeightDirty = false;
13941394 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− }
13991395 m_inContentHeightKeepHeaderShown = m_headerItem && m_headerItem->y() == contentY();
14001396 setContentHeight(contentHeight);
14011397 m_inContentHeightKeepHeaderShown = false;
tests/plugins/Dash/listviewwithpageheadertest.cpp+15
@@ -2008,6 +2008,21 @@ private Q_SLOTS:
20082008 QTRY_COMPARE(lvwph->m_minYExtent, 610.);
20092009 }
20102010
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+
20112026private:
20122027 QQuickView *view;
20132028 ListViewWithPageHeader *lvwph;