@@ -41,7 +41,7 @@ Rectangle {
42 // Edge push progress
42 // Edge push progress
43 // Value range is [0.0, 1.0]
43 // Value range is [0.0, 1.0]
44− readonly property real progress: MathUtils.clamp(priv.accumulatedPush / EdgeBarrierSettings.pushThreshold, 0.0, 1.0)
44+ readonly property real progress: priv.directProgress != -1 ? priv.directProgress : priv.accumulatedProgress
45 onProgressChanged: {
45 onProgressChanged: {
46 print("!!! Progress:", progress)
46 print("!!! Progress:", progress)
@@ -51,6 +51,8 @@ Rectangle {
51 QtObject {
51 QtObject {
54+ readonly property real accumulatedProgress: MathUtils.clamp(accumulatedPush / EdgeBarrierSettings.pushThreshold, 0.0, 1.0)
55+ property real directProgress: -1
54 property real accumulatedPush: 0
56 property real accumulatedPush: 0
56 function push(amount) {
58 function push(amount) {
@@ -85,8 +87,13 @@ Rectangle {
85 fakeRectangle.transformOrigin = edge;
87 fakeRectangle.transformOrigin = edge;
88− function processAnimation(amount, animation) {
90+ function processAnimation(amount, animation, isProgress) {
92+ priv.directProgress = amount;
94+ priv.directProgress = -1;
89− priv.push(amount);
95+ priv.push(amount);
91 if (progress > hintThreshold) { // above 10% we start the full preview animation
98 if (progress > hintThreshold) { // above 10% we start the full preview animation
92 animation.start();
99 animation.start();
@@ -121,56 +128,57 @@ Rectangle {
121 function stop() {
128 function stop() {
122 print("!!! Stop")
129 print("!!! Stop")
123 priv.accumulatedPush = 0;
130 priv.accumulatedPush = 0;
131+ priv.directProgress = -1;
124 edge = -1;
132 edge = -1;
127− function maximize(amount) {
135+ function maximize(amount, isProgress) {
128 if (fakeRectangle.edge != Item.Top) {
136 if (fakeRectangle.edge != Item.Top) {
129 priv.setup(Item.Top);
137 priv.setup(Item.Top);
131− priv.processAnimation(amount, fakeMaximizeAnimation);
139+ priv.processAnimation(amount, fakeMaximizeAnimation, isProgress);
134− function maximizeLeft(amount) {
142+ function maximizeLeft(amount, isProgress) {
135 if (fakeRectangle.edge != Item.Left) {
143 if (fakeRectangle.edge != Item.Left) {
136 priv.setup(Item.Left);
144 priv.setup(Item.Left);
138− priv.processAnimation(amount, fakeMaximizeLeftAnimation);
146+ priv.processAnimation(amount, fakeMaximizeLeftAnimation, isProgress);
141− function maximizeRight(amount) {
149+ function maximizeRight(amount, isProgress) {
142 if (fakeRectangle.edge != Item.Right) {
150 if (fakeRectangle.edge != Item.Right) {
143 priv.setup(Item.Right);
151 priv.setup(Item.Right);
145− priv.processAnimation(amount, fakeMaximizeRightAnimation);
153+ priv.processAnimation(amount, fakeMaximizeRightAnimation, isProgress);
148− function maximizeTopLeft(amount) {
156+ function maximizeTopLeft(amount, isProgress) {
149 if (fakeRectangle.edge != Item.TopLeft) {
157 if (fakeRectangle.edge != Item.TopLeft) {
150 priv.setup(Item.TopLeft);
158 priv.setup(Item.TopLeft);
152− priv.processAnimation(amount, fakeMaximizeTopLeftAnimation);
160+ priv.processAnimation(amount, fakeMaximizeTopLeftAnimation, isProgress);
155− function maximizeTopRight(amount) {
163+ function maximizeTopRight(amount, isProgress) {
156 if (fakeRectangle.edge != Item.TopRight) {
164 if (fakeRectangle.edge != Item.TopRight) {
157 priv.setup(Item.TopRight);
165 priv.setup(Item.TopRight);
159− priv.processAnimation(amount, fakeMaximizeTopRightAnimation);
167+ priv.processAnimation(amount, fakeMaximizeTopRightAnimation, isProgress);
162− function maximizeBottomLeft(amount) {
170+ function maximizeBottomLeft(amount, isProgress) {
163 if (fakeRectangle.edge != Item.BottomLeft) {
171 if (fakeRectangle.edge != Item.BottomLeft) {
164 priv.setup(Item.BottomLeft);
172 priv.setup(Item.BottomLeft);
166− priv.processAnimation(amount, fakeMaximizeBottomLeftAnimation);
174+ priv.processAnimation(amount, fakeMaximizeBottomLeftAnimation, isProgress);
169− function maximizeBottomRight(amount) {
177+ function maximizeBottomRight(amount, isProgress) {
170 if (fakeRectangle.edge != Item.BottomRight) {
178 if (fakeRectangle.edge != Item.BottomRight) {
171 priv.setup(Item.BottomRight);
179 priv.setup(Item.BottomRight);
173− priv.processAnimation(amount, fakeMaximizeBottomRightAnimation);
181+ priv.processAnimation(amount, fakeMaximizeBottomRightAnimation, isProgress);
176 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.BriskDuration } }
184 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.BriskDuration } }