@@ -179,7 +179,6 @@ Item {
179 id: spreadDragArea
179 id: spreadDragArea
180 direction: Direction.Leftwards
180 direction: Direction.Leftwards
182− //enabled: root.available
183 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
182 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
184 width: root.dragAreaWidth
183 width: root.dragAreaWidth
@@ -191,7 +190,6 @@ Item {
191 if (!dragging && !priv.waitingForScreenshot) {
190 if (!dragging && !priv.waitingForScreenshot) {
192 priv.requestNewScreenshot();
191 priv.requestNewScreenshot();
193 spreadView.stage = 0;
192 spreadView.stage = 0;
194− attachedToView = true;
195 spreadView.contentX = -spreadView.shift;
193 spreadView.contentX = -spreadView.shift;
197 if (dragging && !priv.waitingForScreenshot && attachedToView) {
195 if (dragging && !priv.waitingForScreenshot && attachedToView) {
@@ -204,6 +202,12 @@ Item {
204 gesturePoints.push(touchX)
202 gesturePoints.push(touchX)
206+ if (status == DirectionalDragArea.Recognized) {
207+ attachedToView = true;
207 onDraggingChanged: {
211 onDraggingChanged: {
208 var oneWayFlick = true;
212 var oneWayFlick = true;
209 var smallestX = spreadDragArea.width;
213 var smallestX = spreadDragArea.width;
@@ -241,7 +245,7 @@ Item {
241 Flickable {
245 Flickable {
242 id: spreadView
246 id: spreadView
243 anchors.fill: parent
247 anchors.fill: parent
244− visible: spreadDragArea.status == DirectionalDragArea.Recognized || stage > 0 || snapAnimation.running
248+ visible: spreadDragArea.status == DirectionalDragArea.Recognized || stage > 1 || snapAnimation.running
245 contentWidth: spreadRow.width - shift
249 contentWidth: spreadRow.width - shift
246 contentX: -shift
250 contentX: -shift
@@ -271,9 +275,7 @@ Item {
272 property int selectedIndex: -1
276 property int selectedIndex: -1
274− onStageChanged: print("*******stage cahnged", stage)
278+ onShiftedContentXChanged: {
276− onContentXChanged: {
277 switch (stage) {
279 switch (stage) {
279 if (shiftedContentX > width * positionMarker2) {
281 if (shiftedContentX > width * positionMarker2) {
@@ -294,13 +296,10 @@ Item {
294 snapAnimation.targetContentX = -shift;
296 snapAnimation.targetContentX = -shift;
295 snapAnimation.start();
297 snapAnimation.start();
296 } else if (shiftedContentX < positionMarker2 * width) {
298 } else if (shiftedContentX < positionMarker2 * width) {
297− print("selecting tile 1")
298 snapTo(1)
299 snapTo(1)
299 } else if (shiftedContentX < positionMarker3 * width) {
300 } else if (shiftedContentX < positionMarker3 * width) {
300− print("snappoing to stage1")
301 snapTo(1)
301 snapTo(1)
302 } else if (stage < 2){
302 } else if (stage < 2){
303− print("snappoing to stage2")
304 // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
303 // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
305 snapAnimation.targetContentX = width * positionMarker4 + 1 - shift;
304 snapAnimation.targetContentX = width * positionMarker4 + 1 - shift;
306 snapAnimation.start();
305 snapAnimation.start();
@@ -321,14 +320,12 @@ Item {
321 target: spreadView
320 target: spreadView
322 property: "contentX"
321 property: "contentX"
323 to: snapAnimation.targetContentX
322 to: snapAnimation.targetContentX
324− duration: UbuntuAnimation.FastDuration
323+// duration: UbuntuAnimation.FastDuration
325−// duration: UbuntuAnimation.SleepyDuration
324+ duration: UbuntuAnimation.SleepyDuration
327 ScriptAction {
326 ScriptAction {
328 script: {
327 script: {
329−// print("animation finished: stage", spreadView.stage, "contentX", spreadView.contentX, "focused app", ApplicationManager.get(0).appId, ApplicationManager.get(1).appId)
330 if (spreadView.selectedIndex >= 0) {
328 if (spreadView.selectedIndex >= 0) {
331− print("switching to app", snapAnimation.toIndex, ApplicationManager.get(spreadView.selectedIndex).name)
332 ApplicationManager.focusApplication(ApplicationManager.get(spreadView.selectedIndex).appId);
329 ApplicationManager.focusApplication(ApplicationManager.get(spreadView.selectedIndex).appId);
333 spreadView.selectedIndex = -1
330 spreadView.selectedIndex = -1
334 spreadView.stage = 0;
331 spreadView.stage = 0;
@@ -339,7 +336,6 @@ Item {
339 spreadView.stage = 0;
336 spreadView.stage = 0;
340 spreadView.contentX = -spreadView.shift;
337 spreadView.contentX = -spreadView.shift;
342− print("snapping done. stage:", spreadView.stage)
@@ -358,8 +354,8 @@ Item {
358 id: appDelegate
354 id: appDelegate
359 startAngle: 45
355 startAngle: 45
360 endAngle: 5
356 endAngle: 5
361− startScale: 1.2
357+ startScale: 1.1
362− endScale: 0.6
358+ endScale: 0.7
363 startDistance: spreadView.tileDistance
359 startDistance: spreadView.tileDistance
364 endDistance: units.gu(.5)
360 endDistance: units.gu(.5)
365 width: spreadView.width
361 width: spreadView.width
@@ -383,7 +379,7 @@ Item {
383 if (spreadView.stage == 0 && index < 2) {
379 if (spreadView.stage == 0 && index < 2) {
384 if (progress < spreadView.positionMarker1) {
380 if (progress < spreadView.positionMarker1) {
385 return progress;
381 return progress;
386− } else if (progress < spreadView.positionMarker1 + .05){
382+ } else if (progress < spreadView.positionMarker1 + snappingCurve.period){
387 return spreadView.positionMarker1 + snappingCurve.value * 3
383 return spreadView.positionMarker1 + snappingCurve.value * 3
389 return spreadView.positionMarker2
385 return spreadView.positionMarker2
@@ -395,7 +391,7 @@ Item {
395 EasingCurve {
391 EasingCurve {
396 id: snappingCurve
392 id: snappingCurve
397 type: EasingCurve.OutQuad
393 type: EasingCurve.OutQuad
398− period: 0.05//spreadView.positionMarker2 - spreadView.positionMarker1
394+ period: 0.05
399 progress: appDelegate.progress - spreadView.positionMarker1
395 progress: appDelegate.progress - spreadView.positionMarker1