on xenial help sign in
disable swipeToClose while some snapping is happening
6a68e35Michael Zanetti
qml/Stages/PhoneStage.qml+1−1
@@ -286,7 +286,7 @@ Rectangle {
286 otherSelected: spreadView.selectedIndex >= 0 && !selected
286 otherSelected: spreadView.selectedIndex >= 0 && !selected
287 interactive: !spreadView.interactive && spreadView.phase === 0
287 interactive: !spreadView.interactive && spreadView.phase === 0
288 && spreadView.shiftedContentX === 0 && root.interactive && index === 0
288 && spreadView.shiftedContentX === 0 && root.interactive && index === 0
289− swipeToCloseEnabled: spreadView.interactive
289+ swipeToCloseEnabled: spreadView.interactive && !snapAnimation.running
290 maximizedAppTopMargin: root.maximizedAppTopMargin
290 maximizedAppTopMargin: root.maximizedAppTopMargin
291 dropShadow: spreadView.active ||
291 dropShadow: spreadView.active ||
292 (priv.focusedAppDelegate && priv.focusedAppDelegate.x !== 0)
292 (priv.focusedAppDelegate && priv.focusedAppDelegate.x !== 0)
qml/Stages/TabletStage.qml+1−1
@@ -490,7 +490,7 @@ Rectangle {
490 otherSelected: spreadView.selectedIndex >= 0 && !selected
490 otherSelected: spreadView.selectedIndex >= 0 && !selected
491 isInSideStage: priv.sideStageAppId == model.appId
491 isInSideStage: priv.sideStageAppId == model.appId
492 interactive: !spreadView.interactive && spreadView.phase === 0 && root.interactive
492 interactive: !spreadView.interactive && spreadView.phase === 0 && root.interactive
493− swipeToCloseEnabled: spreadView.interactive
493+ swipeToCloseEnabled: spreadView.interactive && !snapAnimation.running
494 maximizedAppTopMargin: root.maximizedAppTopMargin
494 maximizedAppTopMargin: root.maximizedAppTopMargin
495 dragOffset: !isDash && model.appId == priv.mainStageAppId && root.inverseProgress > 0 ? root.inverseProgress : 0
495 dragOffset: !isDash && model.appId == priv.mainStageAppId && root.inverseProgress > 0 ? root.inverseProgress : 0
496 application: ApplicationManager.get(index)
496 application: ApplicationManager.get(index)
tests/qmltests/Stages/tst_PhoneStage.qml+33−3
@@ -274,7 +274,7 @@ Item {
274 compare(ApplicationManager.focusedApplicationId, selectedApp.appId);
274 compare(ApplicationManager.focusedApplicationId, selectedApp.appId);
275 }
275 }
276
276
277− function test_orientation_change_sent_to_focused_app() {
277+ function test_orientationChangeSentToFocusedApp() {
278 phoneStage.orientation = Qt.PortraitOrientation;
278 phoneStage.orientation = Qt.PortraitOrientation;
279 addApps(1);
279 addApps(1);
280
280
@@ -286,7 +286,7 @@ Item {
286 tryCompare(app, "orientation", Qt.LandscapeOrientation);
286 tryCompare(app, "orientation", Qt.LandscapeOrientation);
287 }
287 }
288
288
289− function test_orientation_change_not_sent_to_apps_while_spread_open() {
289+ function test_orientationChangeNotSentToAppsWhileSpreadOpen() {
290 phoneStage.orientation = Qt.PortraitOrientation;
290 phoneStage.orientation = Qt.PortraitOrientation;
291 addApps(1);
291 addApps(1);
292
292
@@ -299,7 +299,7 @@ Item {
299 tryCompare(app, "orientation", Qt.PortraitOrientation);
299 tryCompare(app, "orientation", Qt.PortraitOrientation);
300 }
300 }
301
301
302− function test_orientation_change_not_sent_to_unfocused_app_until_it_focused() {
302+ function test_orientationChangeNotSentToUnfocusedAppUntilItFocused() {
303 phoneStage.orientation = Qt.PortraitOrientation;
303 phoneStage.orientation = Qt.PortraitOrientation;
304 addApps(1);
304 addApps(1);
305
305
@@ -357,5 +357,35 @@ Item {
357 tryCompare(firstApp, "state", ApplicationInfoInterface.Running);
357 tryCompare(firstApp, "state", ApplicationInfoInterface.Running);
358 tryCompare(firstApp, "focused", true);
358 tryCompare(firstApp, "focused", true);
359 }
359 }
360+
361+ function test_cantCloseWhileSnapping() {
362+ addApps(2);
363+
364+ goToSpread();
365+
366+ var spreadView = findChild(phoneStage, "spreadView");
367+ var selectedApp = ApplicationManager.get(2);
368+
369+ goToSpread();
370+
371+ var app0 = findChild(spreadView, "appDelegate0");
372+ var app1 = findChild(spreadView, "appDelegate1");
373+ var app2 = findChild(spreadView, "appDelegate2");
374+
375+ var dragArea0 = findChild(app0, "dragArea");
376+ var dragArea1 = findChild(app1, "dragArea");
377+ var dragArea2 = findChild(app2, "dragArea");
378+
379+ compare(dragArea0.enabled, true);
380+ compare(dragArea1.enabled, true);
381+ compare(dragArea2.enabled, true);
382+
383+ phoneStage.select(selectedApp.appId);
384+
385+ // Make sure all drag areas are disabled instantly. Don't use tryCompare here!
386+ compare(dragArea0.enabled, false);
387+ compare(dragArea1.enabled, false);
388+ compare(dragArea2.enabled, false);
389+ }
360 }
390 }
361}
391}