@@ -349,6 +349,13 @@ AbstractStage {
355+// running: index == 0
356+// onTriggered: print("index", index, "focused:", appDelegate.focus, "x", appDelegate.x, "state", appDelegate.state)
352 onFocusChanged: {
359 onFocusChanged: {
353 if (appRepeater.startingUp)
360 if (appRepeater.startingUp)
@@ -358,12 +365,8 @@ AbstractStage {
358 print("setting focusedAppDelegate to", appDelegate.application.appId)
365 print("setting focusedAppDelegate to", appDelegate.application.appId)
359 priv.focusedAppDelegate = appDelegate;
366 priv.focusedAppDelegate = appDelegate;
361− // If we're orphan (!parent) it means this stage is no longer the current one
362− // and will be deleted shortly. So we should no longer have a say over the model
364− print("raising surface in model", model.id)
368+ print("raising surface in model", model.id)
365− topLevelSurfaceList.raiseId(model.id);
369+ topLevelSurfaceList.raiseId(model.id);
367 } else if (!focus && priv.focusedAppDelegate === appDelegate) {
370 } else if (!focus && priv.focusedAppDelegate === appDelegate) {
368 priv.focusedAppDelegate = null;
371 priv.focusedAppDelegate = null;
369 // FIXME: No idea why the Binding{} doens't update when focusedAppDelegate turns null
372 // FIXME: No idea why the Binding{} doens't update when focusedAppDelegate turns null
@@ -464,7 +467,14 @@ AbstractStage {
466 function playFocusAnimation() {
469 function playFocusAnimation() {
470+ if (state == "stagedrightedge") {
471+ rightEdgeFocusAnimation.start()
467− focusAnimation.start()
473+ focusAnimation.start()
476+ function playHidingAnimation() {
477+ hidingAnimation.start()
470 UbuntuNumberAnimation {
480 UbuntuNumberAnimation {
@@ -475,6 +485,17 @@ AbstractStage {
476 duration: UbuntuAnimation.SnapDuration
486 duration: UbuntuAnimation.SnapDuration
489+ id: rightEdgeFocusAnimation
490+ UbuntuNumberAnimation { target: appDelegate; properties: "x"; to: 0; duration: priv.animationDuration }
491+ UbuntuNumberAnimation { target: decoratedWindow; properties: "angle"; to: 0; duration: priv.animationDuration }
492+ onStopped: appDelegate.focus = true
496+ UbuntuNumberAnimation { target: appDelegate; property: "opacity"; to: 0; duration: priv.animationDuration }
497+ onStopped: appDelegate.opacity = 1
479 SpreadMaths {
500 SpreadMaths {
480 id: spreadMaths
501 id: spreadMaths
@@ -492,8 +513,9 @@ AbstractStage {
492 targetAngle: spreadMaths.animatedAngle
513 targetAngle: spreadMaths.animatedAngle
495−// onXChanged: if (model.application.appId == "unity8-dash") print("dash moved to", x)
516+ onXChanged: if (model.application.appId == "unity8-dash") print("dash moved to", x)
496− onRequestedWidthChanged: if (index == 0) print("requestedWidth", requestedWidth)
517+// onRequestedWidthChanged: if (index == 0) print("requestedWidth", requestedWidth)
518+ onStateChanged: if (model.application.appId == "unity8-dash") print("state changed", state)
497 states: [
519 states: [
499 name: "spread"; when: root.state == "spread"
521 name: "spread"; when: root.state == "spread"
@@ -502,21 +524,23 @@ AbstractStage {
502 x: spreadMaths.animatedX
524 x: spreadMaths.animatedX
503 y: spreadMaths.animatedY
525 y: spreadMaths.animatedY
505− height: appContainer.height
527+ height: decoratedWindow.height + windowInfoItem.height + units.gu(2)
507 PropertyChanges {
529 PropertyChanges {
508 target: decoratedWindow;
530 target: decoratedWindow;
509 showDecoration: false;
531 showDecoration: false;
510− height: units.gu(15)
532+ height: units.gu(40)
511− width: units.gu(15)
533+ width: units.gu(40)
512 angle: spreadMaths.animatedAngle
534 angle: spreadMaths.animatedAngle
513 requestedWidth: decoratedWindow.oldRequestedWidth
535 requestedWidth: decoratedWindow.oldRequestedWidth
514 requestedHeight: decoratedWindow.oldRequestedHeight
536 requestedHeight: decoratedWindow.oldRequestedHeight
516 PropertyChanges { target: inputBlocker; enabled: true }
538 PropertyChanges { target: inputBlocker; enabled: true }
539+ PropertyChanges { target: windowInfoItem; opacity: 1 }
519− name: "stagedrightedge"; when: root.state == "stagedrightedge"
542+ name: "stagedrightedge";
543+ when: root.state == "stagedrightedge" || rightEdgeFocusAnimation.running || hidingAnimation.running
520 PropertyChanges {
544 PropertyChanges {
521 target: stagedRightEdgeMaths
545 target: stagedRightEdgeMaths
522 progress: rightEdgeDragArea.progress
546 progress: rightEdgeDragArea.progress
@@ -525,7 +549,7 @@ AbstractStage {
525 target: appDelegate
549 target: appDelegate
526 y: PanelState.panelHeight
550 y: PanelState.panelHeight
527 x: stagedRightEdgeMaths.animatedX
551 x: stagedRightEdgeMaths.animatedX
528− z: index
552+ z: index +1
530 PropertyChanges {
554 PropertyChanges {
531 target: decoratedWindow;
555 target: decoratedWindow;
@@ -541,7 +565,8 @@ AbstractStage {
541 name: "staged"; when: root.state == "staged"
565 name: "staged"; when: root.state == "staged"
542 PropertyChanges {
566 PropertyChanges {
543 target: appDelegate
567 target: appDelegate
568+ x: appDelegate.focus ? 0 : root.width
544− x: appDelegate.focus ? 0 : root.width; y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
569+ y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
545 visuallyMaximized: true
570 visuallyMaximized: true
547 PropertyChanges {
572 PropertyChanges {
@@ -687,16 +712,16 @@ AbstractStage {
688 Transition {
713 Transition {
689 to: "spread"
714 to: "spread"
690− PropertyAnimation { target: appDelegate; properties: "x,y"; duration: priv.animationDuration }
715+ PropertyAnimation { target: appDelegate; properties: "x,y,height"; duration: priv.animationDuration }
691 PropertyAnimation { target: decoratedWindow; properties: "width,height,angle"; duration: priv.animationDuration }
716 PropertyAnimation { target: decoratedWindow; properties: "width,height,angle"; duration: priv.animationDuration }
693 Transition {
718 Transition {
694 from: "spread"; to: "staged"
719 from: "spread"; to: "staged"
695− PropertyAnimation { target: appDelegate; properties: "x,y"; duration: priv.animationDuration }
720+ PropertyAnimation { target: appDelegate; properties: "x,y,height"; duration: priv.animationDuration }
696 PropertyAnimation { target: decoratedWindow; properties: "angle,width,height"; duration: priv.animationDuration }
721 PropertyAnimation { target: decoratedWindow; properties: "angle,width,height"; duration: priv.animationDuration }
698− Transition { // Ordering is important. This generic case needs to be after spread -> staged
723+ Transition {
699− to: "staged";
724+ from: "windowed"; to: "staged";
700 PropertyAnimation { target: appDelegate; properties: "x,y,width,height"; duration: priv.animationDuration }
725 PropertyAnimation { target: appDelegate; properties: "x,y,width,height"; duration: priv.animationDuration }
@@ -813,6 +838,16 @@ AbstractStage {
813 color: "blue"
838 color: "blue"
814 opacity: .4
839 opacity: .4
844+ anchors { left: parent.left; bottom: parent.bottom }
845+ title: decoratedWindow.title
846+ iconSource: model.application.icon
848+ visible: opacity > 0
849+ Behavior on opacity { UbuntuNumberAnimation { duration: priv.animationDuration } }
@@ -850,6 +885,13 @@ AbstractStage {
889+ id: shortRightEdgeSwipeAnimation
892+ duration: priv.animationDuration
853 SwipeArea {
895 SwipeArea {
854 id: rightEdgeDragArea
896 id: rightEdgeDragArea
855 direction: Direction.Leftwards
897 direction: Direction.Leftwards
@@ -888,6 +930,9 @@ AbstractStage {
889 if (gesturePoints[gesturePoints.length - 1] < -root.width / 2) {
931 if (gesturePoints[gesturePoints.length - 1] < -root.width / 2) {
890 priv.goneToSpread = true;
932 priv.goneToSpread = true;
934+ appRepeater.itemAt(0).playHidingAnimation()
935+ appRepeater.itemAt(1).playFocusAnimation()
893// // Ok. The user released. Find out if it was a one-way movement.
938// // Ok. The user released. Find out if it was a one-way movement.