@@ -181,40 +181,31 @@ Item {
182 // micromovements of the highlight line when user moves the finger across the items while pulling
182 // micromovements of the highlight line when user moves the finger across the items while pulling
183 // the handle downwards.
183 // the handle downwards.
186− onLateralPositionChanged: {
187− if (!currentItem || lateralPosition == -1) {
188− highlight.highlightCenterOffset = 0;
191− if (!enableLateralChanges) return;
185+ property real highlightCenterOffset: {
193− var itemMapped = root.mapToItem(currentItem, lateralPosition, 0);
186+ if (!currentItem || lateralPosition == -1 || !enableLateralChanges) return 0;
195− var distanceFromCenter = itemMapped.x - currentItem.width / 2;
188+ var itemMapped = root.mapToItem(currentItem, lateralPosition, 0);
196− if (distanceFromCenter > 0) {
197− distanceFromCenter = Math.max(0, distanceFromCenter - currentItem.width / 8);
199− distanceFromCenter = Math.min(0, distanceFromCenter + currentItem.width / 8);
202− if (currentItem && currentItem.ownIndex === 0 && distanceFromCenter < 0) {
190+ var distanceFromCenter = itemMapped.x - currentItem.width / 2;
203− highlight.highlightCenterOffset = 0;
204− } else if (currentItem && currentItem.ownIndex === repeater.count-1 & distanceFromCenter > 0) {
191+ if (distanceFromCenter > 0) {
205− highlight.highlightCenterOffset = 0;
192+ distanceFromCenter = Math.max(0, distanceFromCenter - currentItem.width / 8);
206− } else {
193+ } else {
207− highlight.highlightCenterOffset = (distanceFromCenter / (currentItem.width / 4)) * units.gu(1);
194+ distanceFromCenter = Math.min(0, distanceFromCenter + currentItem.width / 8);
212− property real highlightCenterOffset: 0
197+ if (currentItem && currentItem.ownIndex === 0 && distanceFromCenter < 0) {
199+ } else if (currentItem && currentItem.ownIndex === repeater.count-1 & distanceFromCenter > 0) {
202+ return (distanceFromCenter / (currentItem.width / 4)) * units.gu(1);
213 Behavior on highlightCenterOffset {
204 Behavior on highlightCenterOffset {
214 NumberAnimation { duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
205 NumberAnimation { duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
217− property real currentItemX: currentItem ? currentItem.x : 0 // having Behavior
208+ property real currentItemX: currentItem ? currentItem.x : 0
218 Behavior on currentItemX {
209 Behavior on currentItemX {
219 id: currentItemXBehavior
210 id: currentItemXBehavior
220 enabled: !d.firstItemSwitch && expanded
211 enabled: !d.firstItemSwitch && expanded