on xenial help sign in
LVWPH: 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 Approved by: Josh Arenson

commitcd1d1501c7a477f1ff18ec3722a81fe559d54d95 authorAlbert Astals Cid <albert.astals@canonical.com> dateTue 13 Sep 2016, 06:48 (10 years ago) parent9c327b64409bac
2 files changed+16−4
plugins/Dash/listviewwithpageheader.cpp−4 tests/plugins/Dash/listviewwithpageheadertest.cpp+16
plugins/Dash/listviewwithpageheader.cpp−4
@@ -1393,10 +1393,6 @@ void ListViewWithPageHeader::updatePolish()
13931393
13941394 m_contentHeightDirty = false;
13951395 adjustMinYExtent();
1396− if (contentHeight + m_minYExtent < height()) {
1397− // need this since in the previous call to adjustMinYExtent contentHeight is not set yet
1398− m_minYExtent = 0;
1399− }
14001396 m_inContentHeightKeepHeaderShown = m_headerItem && m_headerItem->y() == contentY();
14011397 setContentHeight(contentHeight);
14021398 m_inContentHeightKeepHeaderShown = false;
tests/plugins/Dash/listviewwithpageheadertest.cpp+16
@@ -2008,6 +2008,22 @@ 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+ QTRY_COMPARE(lvwph->contentHeight(), 1050.);
2018+ scrollToBottom();
2019+ QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 0), Q_ARG(QVariant, 530));
2020+ QTRY_COMPARE(lvwph->m_visibleItems.count(), 2);
2021+ QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 1), Q_ARG(QVariant, 1));
2022+ QTRY_COMPARE(lvwph->m_visibleItems.count(), 1);
2023+ verifyItem(0, 50., 530., false);
2024+ QTRY_COMPARE(lvwph->m_minYExtent, 530.);
2025+ }
2026+
20112027private:
20122028 QQuickView *view;
20132029 ListViewWithPageHeader *lvwph;