on xenial help sign in
fixes and improvements according to todays design meeting
005733dMichael Zanetti
qml/Stages/PhoneStage.qml+14−18
@@ -179,7 +179,6 @@ Item {
179 id: spreadDragArea
179 id: spreadDragArea
180 direction: Direction.Leftwards
180 direction: Direction.Leftwards
181
181
182− //enabled: root.available
183 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
182 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
184 width: root.dragAreaWidth
183 width: root.dragAreaWidth
185
184
@@ -191,7 +190,6 @@ Item {
191 if (!dragging && !priv.waitingForScreenshot) {
190 if (!dragging && !priv.waitingForScreenshot) {
192 priv.requestNewScreenshot();
191 priv.requestNewScreenshot();
193 spreadView.stage = 0;
192 spreadView.stage = 0;
194− attachedToView = true;
195 spreadView.contentX = -spreadView.shift;
193 spreadView.contentX = -spreadView.shift;
196 }
194 }
197 if (dragging && !priv.waitingForScreenshot && attachedToView) {
195 if (dragging && !priv.waitingForScreenshot && attachedToView) {
@@ -204,6 +202,12 @@ Item {
204 gesturePoints.push(touchX)
202 gesturePoints.push(touchX)
205 }
203 }
206
204
205+ onStatusChanged: {
206+ if (status == DirectionalDragArea.Recognized) {
207+ attachedToView = true;
208+ }
209+ }
210+
207 onDraggingChanged: {
211 onDraggingChanged: {
208 var oneWayFlick = true;
212 var oneWayFlick = true;
209 var smallestX = spreadDragArea.width;
213 var smallestX = spreadDragArea.width;
@@ -241,7 +245,7 @@ Item {
241 Flickable {
245 Flickable {
242 id: spreadView
246 id: spreadView
243 anchors.fill: parent
247 anchors.fill: parent
244− visible: spreadDragArea.status == DirectionalDragArea.Recognized || stage > 0 || snapAnimation.running
248+ visible: spreadDragArea.status == DirectionalDragArea.Recognized || stage > 1 || snapAnimation.running
245 contentWidth: spreadRow.width - shift
249 contentWidth: spreadRow.width - shift
246 contentX: -shift
250 contentX: -shift
247
251
@@ -271,9 +275,7 @@ Item {
271
275
272 property int selectedIndex: -1
276 property int selectedIndex: -1
273
277
274− onStageChanged: print("*******stage cahnged", stage)
278+ onShiftedContentXChanged: {
275−
276− onContentXChanged: {
277 switch (stage) {
279 switch (stage) {
278 case 0:
280 case 0:
279 if (shiftedContentX > width * positionMarker2) {
281 if (shiftedContentX > width * positionMarker2) {
@@ -294,13 +296,10 @@ Item {
294 snapAnimation.targetContentX = -shift;
296 snapAnimation.targetContentX = -shift;
295 snapAnimation.start();
297 snapAnimation.start();
296 } else if (shiftedContentX < positionMarker2 * width) {
298 } else if (shiftedContentX < positionMarker2 * width) {
297− print("selecting tile 1")
298 snapTo(1)
299 snapTo(1)
299 } else if (shiftedContentX < positionMarker3 * width) {
300 } else if (shiftedContentX < positionMarker3 * width) {
300− print("snappoing to stage1")
301 snapTo(1)
301 snapTo(1)
302 } else if (stage < 2){
302 } else if (stage < 2){
303− print("snappoing to stage2")
304 // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
303 // Add 1 pixel to make sure we definitely hit positionMarker4 even with rounding errors of the animation.
305 snapAnimation.targetContentX = width * positionMarker4 + 1 - shift;
304 snapAnimation.targetContentX = width * positionMarker4 + 1 - shift;
306 snapAnimation.start();
305 snapAnimation.start();
@@ -321,14 +320,12 @@ Item {
321 target: spreadView
320 target: spreadView
322 property: "contentX"
321 property: "contentX"
323 to: snapAnimation.targetContentX
322 to: snapAnimation.targetContentX
324− duration: UbuntuAnimation.FastDuration
323+// duration: UbuntuAnimation.FastDuration
325−// duration: UbuntuAnimation.SleepyDuration
324+ duration: UbuntuAnimation.SleepyDuration
326 }
325 }
327 ScriptAction {
326 ScriptAction {
328 script: {
327 script: {
329−// print("animation finished: stage", spreadView.stage, "contentX", spreadView.contentX, "focused app", ApplicationManager.get(0).appId, ApplicationManager.get(1).appId)
330 if (spreadView.selectedIndex >= 0) {
328 if (spreadView.selectedIndex >= 0) {
331− print("switching to app", snapAnimation.toIndex, ApplicationManager.get(spreadView.selectedIndex).name)
332 ApplicationManager.focusApplication(ApplicationManager.get(spreadView.selectedIndex).appId);
329 ApplicationManager.focusApplication(ApplicationManager.get(spreadView.selectedIndex).appId);
333 spreadView.selectedIndex = -1
330 spreadView.selectedIndex = -1
334 spreadView.stage = 0;
331 spreadView.stage = 0;
@@ -339,7 +336,6 @@ Item {
339 spreadView.stage = 0;
336 spreadView.stage = 0;
340 spreadView.contentX = -spreadView.shift;
337 spreadView.contentX = -spreadView.shift;
341 }
338 }
342− print("snapping done. stage:", spreadView.stage)
343 }
339 }
344 }
340 }
345 }
341 }
@@ -358,8 +354,8 @@ Item {
358 id: appDelegate
354 id: appDelegate
359 startAngle: 45
355 startAngle: 45
360 endAngle: 5
356 endAngle: 5
361− startScale: 1.2
357+ startScale: 1.1
362− endScale: 0.6
358+ endScale: 0.7
363 startDistance: spreadView.tileDistance
359 startDistance: spreadView.tileDistance
364 endDistance: units.gu(.5)
360 endDistance: units.gu(.5)
365 width: spreadView.width
361 width: spreadView.width
@@ -383,7 +379,7 @@ Item {
383 if (spreadView.stage == 0 && index < 2) {
379 if (spreadView.stage == 0 && index < 2) {
384 if (progress < spreadView.positionMarker1) {
380 if (progress < spreadView.positionMarker1) {
385 return progress;
381 return progress;
386− } else if (progress < spreadView.positionMarker1 + .05){
382+ } else if (progress < spreadView.positionMarker1 + snappingCurve.period){
387 return spreadView.positionMarker1 + snappingCurve.value * 3
383 return spreadView.positionMarker1 + snappingCurve.value * 3
388 } else {
384 } else {
389 return spreadView.positionMarker2
385 return spreadView.positionMarker2
@@ -395,7 +391,7 @@ Item {
395 EasingCurve {
391 EasingCurve {
396 id: snappingCurve
392 id: snappingCurve
397 type: EasingCurve.OutQuad
393 type: EasingCurve.OutQuad
398− period: 0.05//spreadView.positionMarker2 - spreadView.positionMarker1
394+ period: 0.05
399 progress: appDelegate.progress - spreadView.positionMarker1
395 progress: appDelegate.progress - spreadView.positionMarker1
400 }
396 }
401
397
qml/Stages/TransformedSpreadDelegate.qml+3−9
@@ -87,16 +87,10 @@ SpreadDelegate {
87 }
87 }
88
88
89 property real negativeProgress: {
89 property real negativeProgress: {
90− switch (index) {
90+ if (index == 1 && spreadView.stage < 2) {
91− case 0:
92 return 0;
91 return 0;
93− case 1:
94− if (spreadView.stage < 2) {
95− return 0;
96− }
97− return -spreadView.tileDistance / spreadView.width
98 }
92 }
99− return -spreadView.positionMarker2 -(index - 2) * (spreadView.tileDistance / spreadView.width);
93+ return -index * spreadView.tileDistance / spreadView.width;
100 }
94 }
101
95
102 function linearAnimation(startProgress, endProgress, startValue, endValue, progress) {
96 function linearAnimation(startProgress, endProgress, startValue, endValue, progress) {
@@ -262,7 +256,7 @@ SpreadDelegate {
262
256
263 EasingCurve {
257 EasingCurve {
264 id: easingCurve
258 id: easingCurve
265− type: EasingCurve.OutQuad
259+ type: EasingCurve.OutSine
266 period: 1 - spreadView.positionMarker2
260 period: 1 - spreadView.positionMarker2
267 progress: root.animatedProgress
261 progress: root.animatedProgress
268 }
262 }