@@ -27,6 +27,9 @@ AbstractStage {
27 objectName: "stages"
27 objectName: "stages"
28 anchors.fill: parent
28 anchors.fill: parent
30+ property bool sideStageVisible: priv.sideStageAppId
31+ property real sideStageWidth: units.gu(40)
30 // Functions to be called from outside
33 // Functions to be called from outside
31 function updateFocusedAppOrientation() {
34 function updateFocusedAppOrientation() {
32 var mainStageAppIndex = priv.indexOf(priv.mainStageAppId);
35 var mainStageAppIndex = priv.indexOf(priv.mainStageAppId);
@@ -71,6 +74,7 @@ AbstractStage {
73 orientationChangesEnabled: priv.mainAppOrientationChangesEnabled
76 orientationChangesEnabled: priv.mainAppOrientationChangesEnabled
77+ dragProgress: spreadRepeater.count > 0 ? spreadRepeater.itemAt(0).animatedProgress : 0
75 onWidthChanged: {
79 onWidthChanged: {
76 spreadView.selectedIndex = -1;
80 spreadView.selectedIndex = -1;
@@ -233,8 +237,6 @@ AbstractStage {
233 contentX: -shift
237 contentX: -shift
235 property int tileDistance: units.gu(20)
239 property int tileDistance: units.gu(20)
236− property int sideStageWidth: units.gu(40)
237− property bool sideStageVisible: priv.sideStageAppId
239 // This indicates when the spreadView is active. That means, all the animations
241 // This indicates when the spreadView is active. That means, all the animations
240 // are activated and tiles need to line up for the spread.
242 // are activated and tiles need to line up for the spread.
@@ -254,14 +256,14 @@ AbstractStage {
254 // 2: The list is dragged further and snaps into the spread view when entering phase 2
256 // 2: The list is dragged further and snaps into the spread view when entering phase 2
255 property int phase
257 property int phase
257− readonly property int phase0Width: sideStageWidth
259+ readonly property int phase0Width: root.sideStageWidth
258− readonly property int phase1Width: sideStageWidth
260+ readonly property int phase1Width: root.sideStageWidth
260 // Those markers mark the various positions in the spread (ratio to screen width from right to left):
262 // Those markers mark the various positions in the spread (ratio to screen width from right to left):
261 // 0 - 1: following finger, snap back to the beginning on release
263 // 0 - 1: following finger, snap back to the beginning on release
262 readonly property real positionMarker1: 0.2
264 readonly property real positionMarker1: 0.2
263 // 1 - 2: curved snapping movement, snap to nextInStack on release
265 // 1 - 2: curved snapping movement, snap to nextInStack on release
264− readonly property real positionMarker2: sideStageWidth / spreadView.width
266+ readonly property real positionMarker2: root.sideStageWidth / spreadView.width
265 // 2 - 3: movement follows finger, snaps to phase 2 (full spread) on release
267 // 2 - 3: movement follows finger, snaps to phase 2 (full spread) on release
266 readonly property real positionMarker3: 0.6
268 readonly property real positionMarker3: 0.6
267 // passing 3, we detach movement from the finger and snap to phase 2 (full spread)
269 // passing 3, we detach movement from the finger and snap to phase 2 (full spread)
@@ -490,7 +492,7 @@ AbstractStage {
490 Rectangle {
492 Rectangle {
491 id: sideStageBackground
493 id: sideStageBackground
492 color: "black"
494 color: "black"
493− width: spreadView.sideStageWidth * (1 - sideStageDragHandle.progress)
495+ width: root.sideStageWidth * (1 - sideStageDragHandle.progress)
494 height: priv.landscapeHeight
496 height: priv.landscapeHeight
495 x: spreadView.width - width
497 x: spreadView.width - width
496 z: spreadView.indexToZIndex(priv.indexOf(priv.sideStageAppId))
498 z: spreadView.indexToZIndex(priv.indexOf(priv.sideStageAppId))
@@ -505,16 +507,16 @@ AbstractStage {
505 width: units.gu(2)
507 width: units.gu(2)
506 height: priv.landscapeHeight
508 height: priv.landscapeHeight
507 z: sideStageBackground.z
509 z: sideStageBackground.z
508− opacity: spreadView.phase <= 0 && spreadView.sideStageVisible ? 1 : 0
510+ opacity: spreadView.phase <= 0 && root.sideStageVisible ? 1 : 0
509 property real progress: 0
511 property real progress: 0
510 property bool dragging: false
512 property bool dragging: false
512 Behavior on opacity { UbuntuNumberAnimation {} }
514 Behavior on opacity { UbuntuNumberAnimation {} }
514 Connections {
516 Connections {
515− target: spreadView
517+ target: root
516 onSideStageVisibleChanged: {
518 onSideStageVisibleChanged: {
517− if (spreadView.sideStageVisible) {
519+ if (root.sideStageVisible) {
518 sideStageDragHandle.progress = 0;
520 sideStageDragHandle.progress = 0;
@@ -546,7 +548,7 @@ AbstractStage {
546 onMouseXChanged: {
548 onMouseXChanged: {
547 totalDiff += mouseX - startX;
549 totalDiff += mouseX - startX;
548 if (priv.mainStageAppId) {
550 if (priv.mainStageAppId) {
549− sideStageDragHandle.progress = Math.max(0, totalDiff / spreadView.sideStageWidth);
551+ sideStageDragHandle.progress = Math.max(0, totalDiff / root.sideStageWidth);
551 gesturePoints.push(mouseX);
553 gesturePoints.push(mouseX);
@@ -586,7 +588,7 @@ AbstractStage {
586 if (wantsMainStage) {
588 if (wantsMainStage) {
587 return spreadView.width;
589 return spreadView.width;
589− return spreadView.sideStageWidth;
591+ return root.sideStageWidth;
592 height: {
594 height: {