on xenial help sign in
Merges
commitbcb867000cd21307e62096b2ed7e7fbc819d9a53 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateFri 19 Sep 2014, 16:45 (12 years ago) parent2d8b25619e741c
5 files changed+15−10
plugins/Dash/listviewwithpageheader.cpp+3−3 qml/Dash/CardTool.qml+2−2 qml/Dash/GenericScopeView.qml+3−4 tests/qmltests/Dash/tst_Card.qml+5 tests/qmltests/Dash/tst_GenericScopeView.qml+2−1
plugins/Dash/listviewwithpageheader.cpp+3−3
@@ -421,12 +421,12 @@ void ListViewWithPageHeader::showHeader()
421421 }
422422}
423423
424−Q_INVOKABLE int ListViewWithPageHeader::firstCreatedIndex() const
424+int ListViewWithPageHeader::firstCreatedIndex() const
425425{
426426 return m_firstVisibleIndex;
427427}
428428
429−Q_INVOKABLE int ListViewWithPageHeader::createdItemCount() const
429+int ListViewWithPageHeader::createdItemCount() const
430430{
431431 return m_visibleItems.count();
432432}
@@ -542,7 +542,7 @@ void ListViewWithPageHeader::adjustHeader(qreal diff)
542542 // (but the header was not shown by it's own position)
543543 // or the header is partially shown and we are not doing a maximizeVisibleArea either
544544 const bool scrolledUp = m_previousContentY > contentY();
545− const bool notRebounding = contentY() + height() < contentHeight();
545+ const bool notRebounding = qRound(contentY() + height()) < qRound(contentHeight());
546546 const bool notShownByItsOwn = contentY() + diff >= m_headerItem->y() + m_headerItem->height();
547547 const bool maximizeVisibleAreaRunning = m_contentYAnimation->isRunning() && contentYAnimationType == ContentYAnimationMaximizeVisibleArea;
548548
qml/Dash/CardTool.qml+2−2
@@ -135,8 +135,8 @@ Item {
135135 */
136136 readonly property int titleAlignment: {
137137 if (template["card-layout"] === "horizontal"
138− || typeof components["title"] !== "object"
139− || components["title"]["align"] !== "center") return Text.AlignLeft;
138+ || (typeof components["title"] !== "object" &&
139+ components["title"]["align"] !== "center")) return Text.AlignLeft;
140140
141141 var keys = ["mascot", "emblem", "subtitle", "attributes", "summary"];
142142
qml/Dash/GenericScopeView.qml+3−4
@@ -175,7 +175,7 @@ FocusScope {
175175
176176 var animate = false;
177177 if (!subPageLoader.open) {
178− var animateShrinking = !shouldExpand && baseItem.y + baseItem.item.collapsedHeight + baseItem.seeAll.height < categoryView.height;
178+ var animateShrinking = !shouldExpand && baseItem.y + baseItem.item.collapsedHeight + baseItem.seeAllButton.height < categoryView.height;
179179 var animateGrowing = shouldExpand && baseItem.y + baseItem.height < categoryView.height;
180180 animate = shrinkingAny || animateShrinking || animateGrowing;
181181 }
@@ -187,7 +187,7 @@ FocusScope {
187187
188188 if (shouldExpand && !subPageLoader.open) {
189189 if (!shrinkingAny) {
190− categoryView.maximizeVisibleArea(firstCreated + i, baseItem.item.expandedHeight + baseItem.seeAll.height);
190+ categoryView.maximizeVisibleArea(firstCreated + i, baseItem.item.expandedHeight + baseItem.seeAllButton.height);
191191 } else {
192192 // If the space that shrkinking is smaller than the one we need to grow we'll call maximizeVisibleArea
193193 // after the shrink/grow animation ends
@@ -224,7 +224,6 @@ FocusScope {
224224 readonly property string category: categoryId
225225 readonly property string headerLink: model.headerLink
226226 readonly property var item: rendererLoader.item
227− readonly property var seeAll: seeAll
228227
229228 function expand(expand, animate) {
230229 heightBehaviour.enabled = animate;
@@ -276,7 +275,7 @@ FocusScope {
276275 for (var i = 0; i < categoryView.createdItemCount(); ++i) {
277276 var baseItem = categoryView.item(firstCreated + i);
278277 if (baseItem.category === categoryView.expandedCategoryId) {
279− categoryView.maximizeVisibleArea(firstCreated + i, baseItem.item.expandedHeight + baseItem.seeAll.height);
278+ categoryView.maximizeVisibleArea(firstCreated + i, baseItem.item.expandedHeight + baseItem.seeAllButton.height);
280279 break;
281280 }
282281 }
tests/qmltests/Dash/tst_Card.qml+5
@@ -206,6 +206,11 @@ Rectangle {
206206 property Item backgroundImage: findChild(card, "backgroundImage")
207207 property Item mascotImage: findChild(card, "mascotImage");
208208
209+ function init() {
210+ loader.visible = true;
211+ NetworkingStatus.limitedBandwith = false;
212+ }
213+
209214 function cleanup() {
210215 selector.selectedIndex = -1;
211216 }
tests/qmltests/Dash/tst_GenericScopeView.qml+2−1
@@ -100,6 +100,7 @@ Item {
100100 function scrollToEnd()
101101 {
102102 var categoryListView = findChild(genericScopeView, "categoryListView");
103+ waitForRendering(categoryListView);
103104 while (!categoryListView.atYEnd) {
104105 mouseFlick(genericScopeView, genericScopeView.width/2, genericScopeView.height - units.gu(8),
105106 genericScopeView.width/2, genericScopeView.y)
@@ -479,7 +480,7 @@ Item {
479480 verify(category1.expanded);
480481 tryCompare(category1, "height", category1.item.expandedHeight + seeAll1.height);
481482 tryCompareFunction(function() {
482− return genericScopeView.categoryView.contentY + category1.y + category1.height + genericScopeView.categoryView.pageHeader.height
483+ return genericScopeView.categoryView.contentY + category1.y + category1.height
483484 == genericScopeView.categoryView.contentHeight;}
484485 , true);
485486 }