on xenial help sign in
Merge lp:~aacid/unity8/lvwph_resize_item_bug
commit5cb5e70f4bf334591f51689cfa4973b656b16d1c authorAlbert Astals <albert.astals@canonical.com> dateThu 13 Feb 2014, 16:54 (13 years ago) parent5fc6641cae8a1f
3 files changed+35−6
plugins/DashViews/listviewwithpageheader.cpp+1−1 po/km.po+7−5 tests/plugins/DashViews/listviewwithpageheadertest.cpp+27
plugins/DashViews/listviewwithpageheader.cpp+1−1
@@ -1073,7 +1073,7 @@ void ListViewWithPageHeader::itemGeometryChanged(QQuickItem * /*item*/, const QR
10731073{
10741074 const qreal heightDiff = newGeometry.height() - oldGeometry.height();
10751075 if (heightDiff != 0) {
1076− if (oldGeometry.y() + oldGeometry.height() + m_clipItem->y() < contentY() && !m_visibleItems.isEmpty()) {
1076+ if (oldGeometry.y() + oldGeometry.height() + m_clipItem->y() <= contentY() && !m_visibleItems.isEmpty()) {
10771077 ListItem *firstItem = m_visibleItems.first();
10781078 firstItem->setY(firstItem->y() - heightDiff);
10791079 adjustMinYExtent();
po/km.po+7−5
@@ -8,14 +8,14 @@ msgstr ""
88"Project-Id-Version: unity8\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2014-02-04 15:43+0000\n"
11−"PO-Revision-Date: 2013-11-20 07:34+0000\n"
11+"PO-Revision-Date: 2014-02-12 07:06+0000\n"
1212"Last-Translator: Khoem Sokhem <khoemsokhem@khmeros.info>\n"
1313"Language-Team: Khmer <km@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
1717"Plural-Forms: nplurals=1; plural=0;\n"
18−"X-Launchpad-Export-Date: 2014-02-12 06:27+0000\n"
18+"X-Launchpad-Export-Date: 2014-02-13 06:51+0000\n"
1919"X-Generator: Launchpad (build 16916)\n"
2020
2121#: plugins/Unity/Launcher/launcheritem.cpp:43
@@ -74,6 +74,8 @@ msgid ""
7474"You have now mastered the edge gestures and can start using the "
7575"phone<br><br>Tap on the screen to start"
7676msgstr ""
77+"ឥឡូវ​អ្នក​បាន​ពិនិត្យ​កាយវិការ​គែម​ "
78+"និង​អាច​ចាប់ផ្ដើម​ប្រើ​ទូរស័ព្ទ<br><br>ប៉ះ លើ​អេក្រង់​ដើម្បី​ចាប់ផ្ដើម"
7779
7880#: qml/Components/PageHeader.qml:339
7981msgid "Recent searches"
@@ -81,11 +83,11 @@ msgstr "ការ​ស្វែងរក​ថ្មី"
8183
8284#: qml/Components/SeeMore.qml:32
8385msgid "See more"
84−msgstr ""
86+msgstr "មើល​ច្រើន​ទៀត"
8587
8688#: qml/Components/SeeMore.qml:61
8789msgid "See less"
88−msgstr ""
90+msgstr "មើល​តិច​ជាង"
8991
9092#: qml/Dash/Apps/AppPreview.qml:136
9193msgid "Rate this"
@@ -159,7 +161,7 @@ msgstr "បង្ហាញ​ពាក្យ​សម្ងាត់"
159161
160162#: qml/Notifications/NotificationMenuItemFactory.qml:103
161163msgid "Please enter SIM PIN"
162−msgstr ""
164+msgstr "បញ្ចូល​កូដ PIN របស់​ស៊ីមកាត"
163165
164166#: qml/Panel/SearchIndicator.qml:27
165167msgid "Search"
tests/plugins/DashViews/listviewwithpageheadertest.cpp+27
@@ -1866,6 +1866,33 @@ private Q_SLOTS:
18661866 QTRY_COMPARE(lvwph->m_headerItem->y(), -lvwph->m_minYExtent);
18671867 }
18681868
1869+ void testResizeRemoveInsertBug1279434()
1870+ {
1871+ QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 0), Q_ARG(QVariant, 6));
1872+ QTRY_COMPARE(lvwph->m_visibleItems.count(), 0);
1873+
1874+ QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 0), Q_ARG(QVariant, 100));
1875+ QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 0), Q_ARG(QVariant, 125));
1876+ QTRY_COMPARE(lvwph->m_visibleItems.count(), 2);
1877+ QCOMPARE(lvwph->m_firstVisibleIndex, 0);
1878+ verifyItem(0, 50., 125., false);
1879+ verifyItem(1, 175., 100., false);
1880+
1881+ lvwph->setContentY(175);
1882+
1883+ model->setProperty(1, "size", 4);
1884+ model->setProperty(0, "size", 4);
1885+
1886+ model->setProperty(0, "size", 6);
1887+
1888+ QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 0), Q_ARG(QVariant, 2));
1889+ QTRY_COMPARE(lvwph->m_visibleItems.count(), 0);
1890+ QCOMPARE(lvwph->m_firstVisibleIndex, -1);
1891+
1892+ QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 0), Q_ARG(QVariant, 100));
1893+ QTRY_COMPARE(lvwph->m_visibleItems.count(), 1);
1894+ }
1895+
18691896private:
18701897 QQuickView *view;
18711898 ListViewWithPageHeader *lvwph;