on xenial help sign in
some more work. short right edge swipe seems to work mostly
5a88633Michael Zanetti
qml/Stages/DesktopStage.qml+64−19
@@ -349,6 +349,13 @@ AbstractStage {
349 }
349 }
350 }
350 }
351
351
352+// Timer {
353+// interval: 1000
354+// repeat: true
355+// running: index == 0
356+// onTriggered: print("index", index, "focused:", appDelegate.focus, "x", appDelegate.x, "state", appDelegate.state)
357+// }
358+
352 onFocusChanged: {
359 onFocusChanged: {
353 if (appRepeater.startingUp)
360 if (appRepeater.startingUp)
354 return;
361 return;
@@ -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;
360
367
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
363− if (root.parent) {
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);
366− }
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 {
464 }
467 }
465
468
466 function playFocusAnimation() {
469 function playFocusAnimation() {
470+ if (state == "stagedrightedge") {
471+ rightEdgeFocusAnimation.start()
472+ } else {
467− focusAnimation.start()
473+ focusAnimation.start()
474+ }
475+ }
476+ function playHidingAnimation() {
477+ hidingAnimation.start()
468 }
478 }
469
479
470 UbuntuNumberAnimation {
480 UbuntuNumberAnimation {
@@ -475,6 +485,17 @@ AbstractStage {
475 to: 1
485 to: 1
476 duration: UbuntuAnimation.SnapDuration
486 duration: UbuntuAnimation.SnapDuration
477 }
487 }
488+ ParallelAnimation {
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
493+ }
494+ ParallelAnimation {
495+ id: hidingAnimation
496+ UbuntuNumberAnimation { target: appDelegate; property: "opacity"; to: 0; duration: priv.animationDuration }
497+ onStopped: appDelegate.opacity = 1
498+ }
478
499
479 SpreadMaths {
500 SpreadMaths {
480 id: spreadMaths
501 id: spreadMaths
@@ -492,8 +513,9 @@ AbstractStage {
492 targetAngle: spreadMaths.animatedAngle
513 targetAngle: spreadMaths.animatedAngle
493 }
514 }
494
515
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: [
498 State {
520 State {
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
504 z: index
526 z: index
505− height: appContainer.height
527+ height: decoratedWindow.height + windowInfoItem.height + units.gu(2)
506 }
528 }
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
515 }
537 }
516 PropertyChanges { target: inputBlocker; enabled: true }
538 PropertyChanges { target: inputBlocker; enabled: true }
539+ PropertyChanges { target: windowInfoItem; opacity: 1 }
517 },
540 },
518 State {
541 State {
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
529 }
553 }
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
546 }
571 }
547 PropertyChanges {
572 PropertyChanges {
@@ -687,16 +712,16 @@ AbstractStage {
687 },
712 },
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 }
692 },
717 },
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 }
697 },
722 },
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 }
701 }
726 }
702 ]
727 ]
@@ -813,6 +838,16 @@ AbstractStage {
813 color: "blue"
838 color: "blue"
814 opacity: .4
839 opacity: .4
815 }
840 }
841+
842+ WindowInfoItem {
843+ id: windowInfoItem
844+ anchors { left: parent.left; bottom: parent.bottom }
845+ title: decoratedWindow.title
846+ iconSource: model.application.icon
847+ opacity: 0
848+ visible: opacity > 0
849+ Behavior on opacity { UbuntuNumberAnimation { duration: priv.animationDuration } }
850+ }
816 }
851 }
817 }
852 }
818 }
853 }
@@ -850,6 +885,13 @@ AbstractStage {
850
885
851 }
886 }
852
887
888+ PropertyAnimation {
889+ id: shortRightEdgeSwipeAnimation
890+ property: "x"
891+ to: 0
892+ duration: priv.animationDuration
893+ }
894+
853 SwipeArea {
895 SwipeArea {
854 id: rightEdgeDragArea
896 id: rightEdgeDragArea
855 direction: Direction.Leftwards
897 direction: Direction.Leftwards
@@ -888,6 +930,9 @@ AbstractStage {
888 } else {
930 } else {
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;
933+ } else {
934+ appRepeater.itemAt(0).playHidingAnimation()
935+ appRepeater.itemAt(1).playFocusAnimation()
891 }
936 }
892
937
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.
qml/Stages/WindowInfoItem.qmlnew file+18
@@ -0,0 +1,18 @@
1+import QtQuick 2.4
2+import Ubuntu.Components 1.3
3+
4+Column {
5+ id: root
6+ property alias title: titleLabel.text
7+ property alias iconSource: icon.source
8+
9+
10+ Image {
11+ id: icon
12+ width: units.gu(5)
13+ height: width
14+ }
15+ Label {
16+ id: titleLabel
17+ }
18+}