@@ -108,7 +108,6 @@ Item {
108 height: parent.height - dashItem.height - parent.spacing*2
108 height: parent.height - dashItem.height - parent.spacing*2
109 model: root.model
109 model: root.model
110 cacheBuffer: itemSize * 3
110 cacheBuffer: itemSize * 3
111− snapMode: ListView.SnapToItem
112 highlightRangeMode: ListView.ApplyRange
111 highlightRangeMode: ListView.ApplyRange
113 preferredHighlightBegin: (height - itemSize) / 2
112 preferredHighlightBegin: (height - itemSize) / 2
114 preferredHighlightEnd: (height + itemSize) / 2
113 preferredHighlightEnd: (height + itemSize) / 2
@@ -116,14 +115,22 @@ Item {
116 // The height of the area where icons start getting folded
115 // The height of the area where icons start getting folded
117 property int foldingAreaHeight: itemSize * 0.75
116 property int foldingAreaHeight: itemSize * 0.75
118 property int itemSize: width
117 property int itemSize: width
119−
118+ property int clickFlickSpeed: units.gu(60)
120− Component.onCompleted: {
119+
121− // This is needed because snapping would partially fold
120+ // Setting snapMode delayed to make sure the ListView stays positioned
122− // the first item on initialisation. This can only be
121+ // at the beginning. If the SnapMode is already set when the model
123− // overridden by mouse interactions - which is what flick()
122+ // delivers the items, it's going to snap immediately. Depending on
124− // simulates. Setting contentY to 0 would not work because
123+ // the height of the list, this might cause the first item to be half
125− // of this.
124+ // folded at the beginning. Once the list is populated we can set the
126− flick(0, units.gu(20))
125+ // snapMode and actually snapping will only happens when the user
126+ // interacts with the list.
132+ launcherListView.snapMode = ListView.SnapToItem
129 delegate: LauncherDelegate {
136 delegate: LauncherDelegate {
@@ -139,7 +146,26 @@ Item {
139 maxAngle: 60
146 maxAngle: 60
141 onClicked: {
148 onClicked: {
149+ // First/last item do the scrolling at more than 12 degrees
150+ if (index == 0 || index == launcherListView.count -1) {
152+ launcherListView.flick(0, -launcherListView.clickFlickSpeed);
153+ } else if (angle < -12) {
154+ launcherListView.flick(0, launcherListView.clickFlickSpeed);
156+ root.applicationSelected(launcherModel.get(index).desktopFile);
161+ // the rest launches apps up to an angle of 30 degrees
163+ launcherListView.flick(0, -launcherListView.clickFlickSpeed);
164+ } else if (angle < -30) {
165+ launcherListView.flick(0, launcherListView.clickFlickSpeed);
142− root.applicationSelected(launcherModel.get(index).desktopFile);
167+ root.applicationSelected(launcherModel.get(index).desktopFile);
@@ -151,9 +177,9 @@ Item {
151 top: parent.top
177 top: parent.top
152 topMargin: launcherListView.topMargin
178 topMargin: launcherListView.topMargin
154− height: launcherListView.itemSize
180+ height: launcherListView.itemSize / 2
155 enabled: launcherListView.contentY > -launcherListView.topMargin
181 enabled: launcherListView.contentY > -launcherListView.topMargin
156− onClicked: launcherListView.flick(0, units.gu(40))
182+ onClicked: launcherListView.flick(0, launcherListView.clickFlickSpeed)
159 MouseArea {
185 MouseArea {
@@ -164,9 +190,9 @@ Item {
164 bottom: parent.bottom
190 bottom: parent.bottom
165 bottomMargin: launcherListView.bottomMargin
191 bottomMargin: launcherListView.bottomMargin
167− height: launcherListView.itemSize
193+ height: launcherListView.itemSize / 2
168 enabled: launcherListView.contentHeight - launcherListView.height - launcherListView.contentY > -launcherListView.bottomMargin
194 enabled: launcherListView.contentHeight - launcherListView.height - launcherListView.contentY > -launcherListView.bottomMargin
169− onClicked: launcherListView.flick(0, -units.gu(40))
195+ onClicked: launcherListView.flick(0, -launcherListView.clickFlickSpeed)