on xenial help sign in
improve focusing animation, not 100% perfect, but let's see what design thinks
commit37ffe94e1a5584282a85e12f2230619fc7a78141 authorMichael Zanetti <michael.zanetti@canonical.com> dateMon 12 Sep 2016, 12:22 (10 years ago) parentfa88508
4 files changed+21−40
debian/changelog−6 qml/Stage/Stage.qml+15−4 qml/Stage/StageMaths.qml+6−5 qml/Stage/SurfaceContainer.qml−25
debian/changelog−6
@@ -1,9 +1,3 @@
1−unity8 (8.14+16.10.20160831.3-0ubuntu1local~1473354833) UNRELEASED; urgency=medium
2−
3− * ''
4−
5− -- Michael Zanetti <michael.zanetti@canonical.com> Thu, 08 Sep 2016 19:13:54 +0200
6−
71unity8 (8.14+16.10.20160831.3-0ubuntu1) yakkety; urgency=medium
82
93 [ Daniel d'Andrada ]
qml/Stage/Stage.qml+15−4
@@ -965,7 +965,7 @@ AbstractStage {
965965 when: (root.mode == "staged" || root.mode == "stagedWithSideStage") && (root.state == "sideStagedRightEdge" || root.state == "stagedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running)
966966 PropertyChanges {
967967 target: stagedRightEdgeMaths
968− progress: Math.max(edgeBarrier.progress, rightEdgeDragArea.progress)
968+ progress: Math.max(edgeBarrier.progress, rightEdgeDragArea.draggedProgress)
969969 }
970970 PropertyChanges {
971971 target: appDelegate
@@ -1021,12 +1021,12 @@ AbstractStage {
10211021 name: "staged"; when: root.state == "staged"
10221022 PropertyChanges {
10231023 target: appDelegate
1024− x: appDelegate.itemIndex == 0 ? 0 : root.width
1024+ x: stageMaths.itemX
10251025 y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
10261026 requestedWidth: appContainer.width
10271027 requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
10281028 visuallyMaximized: true
1029− visible: appDelegate.itemIndex == 0
1029+ visible: appDelegate.x < root.width
10301030 }
10311031 PropertyChanges {
10321032 target: decoratedWindow
@@ -1036,6 +1036,10 @@ AbstractStage {
10361036 target: resizeArea
10371037 enabled: false
10381038 }
1039+ PropertyChanges {
1040+ target: stageMaths
1041+ animateX: !focusAnimation.running && itemIndex !== spreadItem.highlightedIndex
1042+ }
10391043 },
10401044 State {
10411045 name: "stagedWithSideStage"; when: root.state == "stagedWithSideStage"
@@ -1170,7 +1174,6 @@ AbstractStage {
11701174 visuallyMaximized: false
11711175 }
11721176 }
1173−
11741177 ]
11751178 transitions: [
11761179 Transition {
@@ -1571,6 +1574,13 @@ AbstractStage {
15711574 property bool cancelled: false
15721575
15731576 property real progress: dragging ? -touchPosition.x / root.width : 0
1577+ onProgressChanged: {
1578+ if (dragging) {
1579+ draggedProgress = progress;
1580+ }
1581+ }
1582+
1583+ property real draggedProgress: 0
15741584
15751585 onTouchPositionChanged: {
15761586 gesturePoints.push(touchPosition.x);
@@ -1585,6 +1595,7 @@ AbstractStage {
15851595 // A potential edge-drag gesture has started. Start recording it
15861596 gesturePoints = [];
15871597 cancelled = false;
1598+ draggedProgress = 0;
15881599 } else {
15891600 // Ok. The user released. Did he drag far enough to go to full spread?
15901601 if (gesturePoints[gesturePoints.length - 1] < -spreadItem.rightEdgeBreakPoint * spreadItem.width ) {
qml/Stage/StageMaths.qml+6−5
@@ -1,5 +1,6 @@
11import QtQuick 2.4
22import Unity.Application 0.1
3+import Ubuntu.Components 1.3
34
45QtObject {
56 id: root
@@ -10,6 +11,7 @@ QtObject {
1011 property int sceneWidth: 0
1112 property int sideStageWidth: 0
1213 property int sideStageX: sceneWidth
14+ property bool animateX: false
1315
1416 property int stage: ApplicationInfoInterface.MainStage
1517 property var thisDelegate: null
@@ -60,11 +62,10 @@ QtObject {
6062 }
6163
6264
63− readonly property int itemX: mainStageDelegate == thisDelegate ? 0 :
64− sideStageDelegate == thisDelegate ? sideStageX :
65− sceneWidth
65+ property int itemX: mainStageDelegate == thisDelegate ? 0 : sideStageDelegate == thisDelegate ? sideStageX : sceneWidth
66+ Behavior on itemX { enabled: root.animateX; UbuntuNumberAnimation {} }
6667
6768 readonly property int itemWidth: stage == ApplicationInfoInterface.MainStage ?
68− sideStageDelegate != null ? sideStageX : sceneWidth :
69− stage == ApplicationInfoInterface.SideStage ? sideStageWidth : sceneWidth
69+ sideStageDelegate != null ? sideStageX : sceneWidth :
70+ stage == ApplicationInfoInterface.SideStage ? sideStageWidth : sceneWidth
7071}
qml/Stage/SurfaceContainer.qml−25
@@ -69,31 +69,6 @@ FocusScope {
6969
7070 surfaceWidth: root.requestedWidth
7171 surfaceHeight: root.requestedHeight
72−// surfaceWidth: {
73−// print("surfaceWidth:", model.application.appId, root.resizeSurface, root.requestedWidth, width)
74−// if (root.resizeSurface) {
75−// if (root.requestedWidth >= 0) {
76−// return root.requestedWidth;
77−// } else {
78−// return width;
79−// }
80−// } else {
81−// return -1;
82−// }
83−// }
84−
85−// surfaceHeight: {
86−// print("surfaceHeight:", model.application.appId, root.resizeSurface, root.requestedHeight, height)
87−// if (root.resizeSurface) {
88−// if (root.requestedHeight >= 0) {
89−// return root.requestedHeight;
90−// } else {
91−// return height;
92−// }
93−// } else {
94−// return -1;
95−// }
96−// }
9772
9873 enabled: root.interactive
9974 antialiasing: !root.interactive