@@ -35,15 +35,19 @@ Item {
3535
3636 property real lateralPosition: -1
3737 onLateralPositionChanged: {
38− if (lateralPosition == -1) return;
38+ if (currentItem && !enableLateralChanges) return;
39+ updateItemFromLateralPosition(lateralPosition);
40+ highlight.updateHighlightOffset();
41+ }
42+
43+ function updateItemFromLateralPosition(lateralPosition) {
44+ if (lateralPosition === -1) return;
3945
4046 if (!currentItem) {
4147 selectItemAt(lateralPosition);
4248 return;
4349 }
4450
45− if (!enableLateralChanges) return;
46−
4751 var maximumBufferOffset = selectionChangeBuffer * unitProgress;
4852 var proposedItem = indicatorAt(lateralPosition, 0);
4953 if (proposedItem) {
@@ -177,9 +181,11 @@ Item {
177181
178182 // micromovements of the highlight line when user moves the finger across the items while pulling
179183 // the handle downwards.
180− property real highlightCenterOffset: {
181− if (!currentItem || lateralPosition == -1) return 0;
182− if (!enableLateralChanges) return 0;
184+ function updateHighlightOffset() {
185+ if (!currentItem || lateralPosition == -1) {
186+ highlightCenterOffset = 0;
187+ return;
188+ }
183189
184190 var itemMapped = root.mapToItem(currentItem, lateralPosition, 0);
185191
@@ -191,24 +197,25 @@ Item {
191197 }
192198
193199 if (currentItem && currentItem.ownIndex === 0 && distanceFromCenter < 0) {
194− return 0;
200+ highlightCenterOffset = 0;
195201 } else if (currentItem && currentItem.ownIndex === repeater.count-1 & distanceFromCenter > 0) {
196− return 0;
202+ highlightCenterOffset = 0;
203+ } else {
204+ var shiftPercentageOffset = (distanceFromCenter / (currentItem.width / 4));
205+ highlightCenterOffset = shiftPercentageOffset * units.gu(1);
197206 }
198207
199− var shiftPercentageOffset = (distanceFromCenter / (currentItem.width / 4));
200− return shiftPercentageOffset * units.gu(1);
201208 }
209+ property real highlightCenterOffset: 0
202210 Behavior on highlightCenterOffset {
203− id: highlightCetnerOffsetBehavior
204− SmoothedAnimation { duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
211+ NumberAnimation { duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
205212 }
206213
207214 property real currentItemX: currentItem ? currentItem.x : 0 // having Behavior
208215 Behavior on currentItemX {
209216 id: currentItemXBehavior
210217 enabled: !d.firstItemSwitch && expanded
211− SmoothedAnimation { duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
218+ NumberAnimation { duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
212219 }
213220 x: currentItemX + highlightCenterOffset
214221 }