on xenial help sign in
some commenting and cleanup
7a8b36aMichael Zanetti
qml/Stages/PhoneStage.qml+5−1
@@ -346,6 +346,7 @@ Item {
346 duration: UbuntuAnimation.FastDuration
346 duration: UbuntuAnimation.FastDuration
347// duration: UbuntuAnimation.SleepyDuration
347// duration: UbuntuAnimation.SleepyDuration
348 }
348 }
349+
349 ScriptAction {
350 ScriptAction {
350 script: {
351 script: {
351 if (spreadView.selectedIndex >= 0) {
352 if (spreadView.selectedIndex >= 0) {
@@ -365,7 +366,7 @@ Item {
365
366
366 Item {
367 Item {
367 id: spreadRow
368 id: spreadRow
368− width: ApplicationManager.count * spreadView.tileDistance + (spreadView.width - spreadView.tileDistance) * 1.5 //(spreadView.width * spreadView.positionMarker2) + (spreadView.width - spreadView.tileDistance)
369+ width: ApplicationManager.count * spreadView.tileDistance + (spreadView.width - spreadView.tileDistance) * 1.5
369
370
370 x: spreadView.contentX
371 x: spreadView.contentX
371
372
@@ -388,6 +389,8 @@ Item {
388 z: index
389 z: index
389 x: index == 0 ? 0 : spreadView.width + (index - 1) * spreadView.tileDistance
390 x: index == 0 ? 0 : spreadView.width + (index - 1) * spreadView.tileDistance
390
391
392+ // Each tile has a different progress value running from 0 to 1.
393+ // A progress value of 0 means the tile is at the right edge. 1 means the tile has reched the left edge.
391 progress: {
394 progress: {
392 var tileProgress = (spreadView.shiftedContentX - index * spreadView.tileDistance) / spreadView.width
395 var tileProgress = (spreadView.shiftedContentX - index * spreadView.tileDistance) / spreadView.width
393 // Tile 1 needs to move directly from the beginning...
396 // Tile 1 needs to move directly from the beginning...
@@ -397,6 +400,7 @@ Item {
397 return tileProgress;
400 return tileProgress;
398 }
401 }
399
402
403+ // This mostly is the same as progress, just adds the snapping to stage 1 for tiles 0 and 1
400 animatedProgress: {
404 animatedProgress: {
401 if (spreadView.stage == 0 && index < 2) {
405 if (spreadView.stage == 0 && index < 2) {
402 if (progress < spreadView.positionMarker1) {
406 if (progress < spreadView.positionMarker1) {