on xenial help sign in
fix a glitch with spread positioning
commit3f45bce2c3abab8e5698b00f50c0622f890ce5c8 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 26 Jan 2017, 18:01 (10 years ago) parentc2efa54
1 file changed+3−3
qml/Stage/Stage.qml+3−3
qml/Stage/Stage.qml+3−3
@@ -502,7 +502,6 @@ FocusScope {
502502 Transition {
503503 to: "spread"
504504 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
505− PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
506505 },
507506 Transition {
508507 from: "spread"
@@ -517,6 +516,7 @@ FocusScope {
517516 }
518517 }
519518 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
519+ PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
520520 }
521521 },
522522 Transition {
@@ -1805,11 +1805,11 @@ FocusScope {
18051805 var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
18061806 if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
18071807 var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
1808− snapAnimation.to = floatingFlickable.contentX - offset;
1808+ snapAnimation.to = Math.max(0, floatingFlickable.contentX - offset);
18091809 snapAnimation.start();
18101810 } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
18111811 var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
1812− snapAnimation.to = floatingFlickable.contentX - offset;
1812+ snapAnimation.to = Math.max(0, floatingFlickable.contentX - offset);
18131813 snapAnimation.start();
18141814 }
18151815 }