on xenial help sign in
fix some glitches with spread positioning
6c6f59aMichael Zanetti
qml/Stage/Stage.qml+3−3
@@ -506,7 +506,6 @@ FocusScope {
506 Transition {
506 Transition {
507 to: "spread"
507 to: "spread"
508 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
508 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
509− PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
510 },
509 },
511 Transition {
510 Transition {
512 from: "spread"
511 from: "spread"
@@ -521,6 +520,7 @@ FocusScope {
521 }
520 }
522 }
521 }
523 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
522 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
523+ PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
524 }
524 }
525 },
525 },
526 Transition {
526 Transition {
@@ -1850,11 +1850,11 @@ FocusScope {
1850 var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
1850 var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
1851 if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
1851 if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
1852 var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
1852 var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
1853− snapAnimation.to = floatingFlickable.contentX - offset;
1853+ snapAnimation.to = Math.max(0, floatingFlickable.contentX - offset);
1854 snapAnimation.start();
1854 snapAnimation.start();
1855 } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
1855 } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
1856 var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
1856 var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
1857− snapAnimation.to = floatingFlickable.contentX - offset;
1857+ snapAnimation.to = Math.max(0, floatingFlickable.contentX - offset);
1858 snapAnimation.start();
1858 snapAnimation.start();
1859 }
1859 }
1860 }
1860 }