on xenial help sign in
Merges
bcb8670Andrea Cimitan
plugins/Dash/listviewwithpageheader.cpp+3−3
@@ -421,12 +421,12 @@ void ListViewWithPageHeader::showHeader()
421 }
421 }
422}
422}
423
423
424−Q_INVOKABLE int ListViewWithPageHeader::firstCreatedIndex() const
424+int ListViewWithPageHeader::firstCreatedIndex() const
425{
425{
426 return m_firstVisibleIndex;
426 return m_firstVisibleIndex;
427}
427}
428
428
429−Q_INVOKABLE int ListViewWithPageHeader::createdItemCount() const
429+int ListViewWithPageHeader::createdItemCount() const
430{
430{
431 return m_visibleItems.count();
431 return m_visibleItems.count();
432}
432}
@@ -542,7 +542,7 @@ void ListViewWithPageHeader::adjustHeader(qreal diff)
542 // (but the header was not shown by it's own position)
542 // (but the header was not shown by it's own position)
543 // or the header is partially shown and we are not doing a maximizeVisibleArea either
543 // or the header is partially shown and we are not doing a maximizeVisibleArea either
544 const bool scrolledUp = m_previousContentY > contentY();
544 const bool scrolledUp = m_previousContentY > contentY();
545− const bool notRebounding = contentY() + height() < contentHeight();
545+ const bool notRebounding = qRound(contentY() + height()) < qRound(contentHeight());
546 const bool notShownByItsOwn = contentY() + diff >= m_headerItem->y() + m_headerItem->height();
546 const bool notShownByItsOwn = contentY() + diff >= m_headerItem->y() + m_headerItem->height();
547 const bool maximizeVisibleAreaRunning = m_contentYAnimation->isRunning() && contentYAnimationType == ContentYAnimationMaximizeVisibleArea;
547 const bool maximizeVisibleAreaRunning = m_contentYAnimation->isRunning() && contentYAnimationType == ContentYAnimationMaximizeVisibleArea;
548
548
qml/Dash/CardTool.qml+2−2
@@ -135,8 +135,8 @@ Item {
135 */
135 */
136 readonly property int titleAlignment: {
136 readonly property int titleAlignment: {
137 if (template["card-layout"] === "horizontal"
137 if (template["card-layout"] === "horizontal"
138− || typeof components["title"] !== "object"
138+ || (typeof components["title"] !== "object" &&
139− || components["title"]["align"] !== "center") return Text.AlignLeft;
139+ components["title"]["align"] !== "center")) return Text.AlignLeft;
140
140
141 var keys = ["mascot", "emblem", "subtitle", "attributes", "summary"];
141 var keys = ["mascot", "emblem", "subtitle", "attributes", "summary"];
142
142
qml/Dash/GenericScopeView.qml+3−4
@@ -175,7 +175,7 @@ FocusScope {
175
175
176 var animate = false;
176 var animate = false;
177 if (!subPageLoader.open) {
177 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;
179 var animateGrowing = shouldExpand && baseItem.y + baseItem.height < categoryView.height;
179 var animateGrowing = shouldExpand && baseItem.y + baseItem.height < categoryView.height;
180 animate = shrinkingAny || animateShrinking || animateGrowing;
180 animate = shrinkingAny || animateShrinking || animateGrowing;
181 }
181 }
@@ -187,7 +187,7 @@ FocusScope {
187
187
188 if (shouldExpand && !subPageLoader.open) {
188 if (shouldExpand && !subPageLoader.open) {
189 if (!shrinkingAny) {
189 if (!shrinkingAny) {
190− categoryView.maximizeVisibleArea(firstCreated + i, baseItem.item.expandedHeight + baseItem.seeAll.height);
190+ categoryView.maximizeVisibleArea(firstCreated + i, baseItem.item.expandedHeight + baseItem.seeAllButton.height);
191 } else {
191 } else {
192 // If the space that shrkinking is smaller than the one we need to grow we'll call maximizeVisibleArea
192 // If the space that shrkinking is smaller than the one we need to grow we'll call maximizeVisibleArea
193 // after the shrink/grow animation ends
193 // after the shrink/grow animation ends
@@ -224,7 +224,6 @@ FocusScope {
224 readonly property string category: categoryId
224 readonly property string category: categoryId
225 readonly property string headerLink: model.headerLink
225 readonly property string headerLink: model.headerLink
226 readonly property var item: rendererLoader.item
226 readonly property var item: rendererLoader.item
227− readonly property var seeAll: seeAll
228
227
229 function expand(expand, animate) {
228 function expand(expand, animate) {
230 heightBehaviour.enabled = animate;
229 heightBehaviour.enabled = animate;
@@ -276,7 +275,7 @@ FocusScope {
276 for (var i = 0; i < categoryView.createdItemCount(); ++i) {
275 for (var i = 0; i < categoryView.createdItemCount(); ++i) {
277 var baseItem = categoryView.item(firstCreated + i);
276 var baseItem = categoryView.item(firstCreated + i);
278 if (baseItem.category === categoryView.expandedCategoryId) {
277 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);
280 break;
279 break;
281 }
280 }
282 }
281 }
tests/qmltests/Dash/tst_Card.qml+5
@@ -206,6 +206,11 @@ Rectangle {
206 property Item backgroundImage: findChild(card, "backgroundImage")
206 property Item backgroundImage: findChild(card, "backgroundImage")
207 property Item mascotImage: findChild(card, "mascotImage");
207 property Item mascotImage: findChild(card, "mascotImage");
208
208
209+ function init() {
210+ loader.visible = true;
211+ NetworkingStatus.limitedBandwith = false;
212+ }
213+
209 function cleanup() {
214 function cleanup() {
210 selector.selectedIndex = -1;
215 selector.selectedIndex = -1;
211 }
216 }
tests/qmltests/Dash/tst_GenericScopeView.qml+2−1
@@ -100,6 +100,7 @@ Item {
100 function scrollToEnd()
100 function scrollToEnd()
101 {
101 {
102 var categoryListView = findChild(genericScopeView, "categoryListView");
102 var categoryListView = findChild(genericScopeView, "categoryListView");
103+ waitForRendering(categoryListView);
103 while (!categoryListView.atYEnd) {
104 while (!categoryListView.atYEnd) {
104 mouseFlick(genericScopeView, genericScopeView.width/2, genericScopeView.height - units.gu(8),
105 mouseFlick(genericScopeView, genericScopeView.width/2, genericScopeView.height - units.gu(8),
105 genericScopeView.width/2, genericScopeView.y)
106 genericScopeView.width/2, genericScopeView.y)
@@ -479,7 +480,7 @@ Item {
479 verify(category1.expanded);
480 verify(category1.expanded);
480 tryCompare(category1, "height", category1.item.expandedHeight + seeAll1.height);
481 tryCompare(category1, "height", category1.item.expandedHeight + seeAll1.height);
481 tryCompareFunction(function() {
482 tryCompareFunction(function() {
482− return genericScopeView.categoryView.contentY + category1.y + category1.height + genericScopeView.categoryView.pageHeader.height
483+ return genericScopeView.categoryView.contentY + category1.y + category1.height
483 == genericScopeView.categoryView.contentHeight;}
484 == genericScopeView.categoryView.contentHeight;}
484 , true);
485 , true);
485 }
486 }