@@ -52,14 +52,14 @@ Rectangle {
52 if (highlightIndex >= launcherListView.count) {
52 if (highlightIndex >= launcherListView.count) {
53 highlightIndex = -1;
53 highlightIndex = -1;
55− moveAnimation.moveToIndex(Math.max(highlightIndex, 0));
55+ launcherListView.moveToIndex(Math.max(highlightIndex, 0));
57 function highlightPrevious() {
57 function highlightPrevious() {
58 highlightIndex--;
58 highlightIndex--;
59 if (highlightIndex <= -2) {
59 if (highlightIndex <= -2) {
60 highlightIndex = launcherListView.count - 1;
60 highlightIndex = launcherListView.count - 1;
62− moveAnimation.moveToIndex(Math.max(highlightIndex, 0));
62+ launcherListView.moveToIndex(Math.max(highlightIndex, 0));
64 function openQuicklist(index) {
64 function openQuicklist(index) {
65 quickList.open(index);
65 quickList.open(index);
@@ -136,7 +136,6 @@ Rectangle {
136 highlightRangeMode: ListView.ApplyRange
136 highlightRangeMode: ListView.ApplyRange
137 preferredHighlightBegin: (height - itemHeight) / 2
137 preferredHighlightBegin: (height - itemHeight) / 2
138 preferredHighlightEnd: (height + itemHeight) / 2
138 preferredHighlightEnd: (height + itemHeight) / 2
139− spacing: units.gu(1)
141 // for the single peeking icon, when alert-state is set on delegate
140 // for the single peeking icon, when alert-state is set on delegate
142 property int peekingIndex: -1
141 property int peekingIndex: -1
@@ -165,7 +164,7 @@ Rectangle {
165 // The height of the area where the items reach the final folding angle
164 // The height of the area where the items reach the final folding angle
166 property int foldingStopHeight: foldingStartHeight - itemHeight - spacing
165 property int foldingStopHeight: foldingStartHeight - itemHeight - spacing
167 property int itemWidth: width * .75
166 property int itemWidth: width * .75
168− property int itemHeight: itemWidth * 15 / 16
167+ property int itemHeight: itemWidth * 15 / 16 + units.gu(1)
169 property int clickFlickSpeed: units.gu(60)
168 property int clickFlickSpeed: units.gu(60)
170 property int draggedIndex: dndArea.draggedIndex
169 property int draggedIndex: dndArea.draggedIndex
171 property real realContentY: contentY - originY + topMargin
170 property real realContentY: contentY - originY + topMargin
@@ -193,23 +192,24 @@ Rectangle {
194 UbuntuNumberAnimation {
193 UbuntuNumberAnimation {
195 id: moveAnimation
194 id: moveAnimation
195+ objectName: "moveAnimation"
196 target: launcherListView
196 target: launcherListView
197 property: "contentY"
197 property: "contentY"
198 function moveTo(contentY) {
198 function moveTo(contentY) {
199 from = launcherListView.contentY;
199 from = launcherListView.contentY;
200 to = contentY;
200 to = contentY;
201− start();
201+ restart();
203− function moveToIndex(index) {
204+ function moveToIndex(index) {
204− var totalItemHeight = launcherListView.itemHeight + launcherListView.spacing
205+ var totalItemHeight = launcherListView.itemHeight + launcherListView.spacing
205− var itemPosition = index * totalItemHeight;
206+ var itemPosition = index * totalItemHeight;
206− var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin
207+ var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin
207− var distanceToEnd = index == 0 || index == launcherListView.count - 1 ? 0 : totalItemHeight
208+ var distanceToEnd = index == 0 || index == launcherListView.count - 1 ? 0 : totalItemHeight
208− if (itemPosition + totalItemHeight + distanceToEnd > launcherListView.contentY + launcherListView.originY + launcherListView.topMargin + height) {
209+ if (itemPosition + totalItemHeight + distanceToEnd > launcherListView.contentY + launcherListView.originY + launcherListView.topMargin + height) {
209− moveAnimation.moveTo(itemPosition + launcherListView.itemHeight - launcherListView.topMargin - height + distanceToEnd - launcherListView.originY);
210+ moveAnimation.moveTo(itemPosition + launcherListView.itemHeight - launcherListView.topMargin - height + distanceToEnd - launcherListView.originY);
210− } else if (itemPosition - distanceToEnd < launcherListView.contentY - launcherListView.originY + launcherListView.topMargin) {
211+ } else if (itemPosition - distanceToEnd < launcherListView.contentY - launcherListView.originY + launcherListView.topMargin) {
211− moveAnimation.moveTo(itemPosition - distanceToEnd - launcherListView.topMargin + launcherListView.originY);
212+ moveAnimation.moveTo(itemPosition - distanceToEnd - launcherListView.topMargin + launcherListView.originY);
@@ -276,7 +276,7 @@ Rectangle {
276 onAlertingChanged: {
276 onAlertingChanged: {
277 if(alerting) {
277 if(alerting) {
278 if (!dragging && (launcherListView.peekingIndex === -1 || launcher.visibleWidth > 0)) {
278 if (!dragging && (launcherListView.peekingIndex === -1 || launcher.visibleWidth > 0)) {
279− moveAnimation.moveToIndex(index)
279+ launcherListView.moveToIndex(index)
280 if (!dragging && launcher.state !== "visible") {
280 if (!dragging && launcher.state !== "visible") {
281 peekingAnimation.start()
281 peekingAnimation.start()
@@ -433,10 +433,8 @@ Rectangle {
434 // First/last item do the scrolling at more than 12 degrees
434 // First/last item do the scrolling at more than 12 degrees
435 if (index == 0 || index == launcherListView.count - 1) {
435 if (index == 0 || index == launcherListView.count - 1) {
436− if (clickedItem.angle > 12) {
436+ if (clickedItem.angle > 12 || clickedItem.angle < -12) {
437− launcherListView.flick(0, -launcherListView.clickFlickSpeed);
437+ launcherListView.moveToIndex(index);
438− } else if (clickedItem.angle < -12) {
439− launcherListView.flick(0, launcherListView.clickFlickSpeed);
441 root.applicationSelected(LauncherModel.get(index).appId);
439 root.applicationSelected(LauncherModel.get(index).appId);
@@ -444,10 +442,8 @@ Rectangle {
446 // the rest launches apps up to an angle of 30 degrees
444 // the rest launches apps up to an angle of 30 degrees
447− if (clickedItem.angle > 30) {
445+ if (clickedItem.angle > 30 || clickedItem.angle < -30) {
448− launcherListView.flick(0, -launcherListView.clickFlickSpeed);
446+ launcherListView.moveToIndex(index);
449− } else if (clickedItem.angle < -30) {
450− launcherListView.flick(0, launcherListView.clickFlickSpeed);
452 root.applicationSelected(LauncherModel.get(index).appId);
448 root.applicationSelected(LauncherModel.get(index).appId);