on xenial help sign in
improve focusing animation, not 100% perfect, but let's see what design thinks
37ffe94Michael Zanetti
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−
7unity8 (8.14+16.10.20160831.3-0ubuntu1) yakkety; urgency=medium
1unity8 (8.14+16.10.20160831.3-0ubuntu1) yakkety; urgency=medium
8
2
9 [ Daniel d'Andrada ]
3 [ Daniel d'Andrada ]
qml/Stage/Stage.qml+15−4
@@ -965,7 +965,7 @@ AbstractStage {
965 when: (root.mode == "staged" || root.mode == "stagedWithSideStage") && (root.state == "sideStagedRightEdge" || root.state == "stagedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running)
965 when: (root.mode == "staged" || root.mode == "stagedWithSideStage") && (root.state == "sideStagedRightEdge" || root.state == "stagedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running)
966 PropertyChanges {
966 PropertyChanges {
967 target: stagedRightEdgeMaths
967 target: stagedRightEdgeMaths
968− progress: Math.max(edgeBarrier.progress, rightEdgeDragArea.progress)
968+ progress: Math.max(edgeBarrier.progress, rightEdgeDragArea.draggedProgress)
969 }
969 }
970 PropertyChanges {
970 PropertyChanges {
971 target: appDelegate
971 target: appDelegate
@@ -1021,12 +1021,12 @@ AbstractStage {
1021 name: "staged"; when: root.state == "staged"
1021 name: "staged"; when: root.state == "staged"
1022 PropertyChanges {
1022 PropertyChanges {
1023 target: appDelegate
1023 target: appDelegate
1024− x: appDelegate.itemIndex == 0 ? 0 : root.width
1024+ x: stageMaths.itemX
1025 y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1025 y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1026 requestedWidth: appContainer.width
1026 requestedWidth: appContainer.width
1027 requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1027 requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1028 visuallyMaximized: true
1028 visuallyMaximized: true
1029− visible: appDelegate.itemIndex == 0
1029+ visible: appDelegate.x < root.width
1030 }
1030 }
1031 PropertyChanges {
1031 PropertyChanges {
1032 target: decoratedWindow
1032 target: decoratedWindow
@@ -1036,6 +1036,10 @@ AbstractStage {
1036 target: resizeArea
1036 target: resizeArea
1037 enabled: false
1037 enabled: false
1038 }
1038 }
1039+ PropertyChanges {
1040+ target: stageMaths
1041+ animateX: !focusAnimation.running && itemIndex !== spreadItem.highlightedIndex
1042+ }
1039 },
1043 },
1040 State {
1044 State {
1041 name: "stagedWithSideStage"; when: root.state == "stagedWithSideStage"
1045 name: "stagedWithSideStage"; when: root.state == "stagedWithSideStage"
@@ -1170,7 +1174,6 @@ AbstractStage {
1170 visuallyMaximized: false
1174 visuallyMaximized: false
1171 }
1175 }
1172 }
1176 }
1173−
1174 ]
1177 ]
1175 transitions: [
1178 transitions: [
1176 Transition {
1179 Transition {
@@ -1571,6 +1574,13 @@ AbstractStage {
1571 property bool cancelled: false
1574 property bool cancelled: false
1572
1575
1573 property real progress: dragging ? -touchPosition.x / root.width : 0
1576 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
1574
1584
1575 onTouchPositionChanged: {
1585 onTouchPositionChanged: {
1576 gesturePoints.push(touchPosition.x);
1586 gesturePoints.push(touchPosition.x);
@@ -1585,6 +1595,7 @@ AbstractStage {
1585 // A potential edge-drag gesture has started. Start recording it
1595 // A potential edge-drag gesture has started. Start recording it
1586 gesturePoints = [];
1596 gesturePoints = [];
1587 cancelled = false;
1597 cancelled = false;
1598+ draggedProgress = 0;
1588 } else {
1599 } else {
1589 // Ok. The user released. Did he drag far enough to go to full spread?
1600 // Ok. The user released. Did he drag far enough to go to full spread?
1590 if (gesturePoints[gesturePoints.length - 1] < -spreadItem.rightEdgeBreakPoint * spreadItem.width ) {
1601 if (gesturePoints[gesturePoints.length - 1] < -spreadItem.rightEdgeBreakPoint * spreadItem.width ) {
qml/Stage/StageMaths.qml+6−5
@@ -1,5 +1,6 @@
1import QtQuick 2.4
1import QtQuick 2.4
2import Unity.Application 0.1
2import Unity.Application 0.1
3+import Ubuntu.Components 1.3
3
4
4QtObject {
5QtObject {
5 id: root
6 id: root
@@ -10,6 +11,7 @@ QtObject {
10 property int sceneWidth: 0
11 property int sceneWidth: 0
11 property int sideStageWidth: 0
12 property int sideStageWidth: 0
12 property int sideStageX: sceneWidth
13 property int sideStageX: sceneWidth
14+ property bool animateX: false
13
15
14 property int stage: ApplicationInfoInterface.MainStage
16 property int stage: ApplicationInfoInterface.MainStage
15 property var thisDelegate: null
17 property var thisDelegate: null
@@ -60,11 +62,10 @@ QtObject {
60 }
62 }
61
63
62
64
63− readonly property int itemX: mainStageDelegate == thisDelegate ? 0 :
65+ property int itemX: mainStageDelegate == thisDelegate ? 0 : sideStageDelegate == thisDelegate ? sideStageX : sceneWidth
64− sideStageDelegate == thisDelegate ? sideStageX :
66+ Behavior on itemX { enabled: root.animateX; UbuntuNumberAnimation {} }
65− sceneWidth
66
67
67 readonly property int itemWidth: stage == ApplicationInfoInterface.MainStage ?
68 readonly property int itemWidth: stage == ApplicationInfoInterface.MainStage ?
68− sideStageDelegate != null ? sideStageX : sceneWidth :
69+ sideStageDelegate != null ? sideStageX : sceneWidth :
69− stage == ApplicationInfoInterface.SideStage ? sideStageWidth : sceneWidth
70+ stage == ApplicationInfoInterface.SideStage ? sideStageWidth : sceneWidth
70}
71}
qml/Stage/SurfaceContainer.qml−25
@@ -69,31 +69,6 @@ FocusScope {
69
69
70 surfaceWidth: root.requestedWidth
70 surfaceWidth: root.requestedWidth
71 surfaceHeight: root.requestedHeight
71 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−// }
97
72
98 enabled: root.interactive
73 enabled: root.interactive
99 antialiasing: !root.interactive
74 antialiasing: !root.interactive