@@ -31,6 +31,8 @@ Item {
31 anchors { fill: parent; rightMargin: units.gu(30) }
31 anchors { fill: parent; rightMargin: units.gu(30) }
32 dragAreaWidth: units.gu(2)
32 dragAreaWidth: units.gu(2)
33 maximizedAppTopMargin: units.gu(3) + units.dp(2)
33 maximizedAppTopMargin: units.gu(3) + units.dp(2)
35+ orientation: Qt.PortraitOrientation
@@ -67,6 +69,21 @@ Item {
67 ApplicationManager.get(appList.selectedAppIndex).setState(ApplicationInfoInterface.Stopped);
69 ApplicationManager.get(appList.selectedAppIndex).setState(ApplicationInfoInterface.Stopped);
73+ anchors { left: parent.left; right: parent.right }
74+ text: "Rotate device \u27F3"
76+ if (phoneStage.orientation == Qt.PortraitOrientation) {
77+ phoneStage.orientation = Qt.LandscapeOrientation;
78+ } else if (phoneStage.orientation == Qt.LandscapeOrientation) {
79+ phoneStage.orientation = Qt.InvertedPortraitOrientation;
80+ } else if (phoneStage.orientation == Qt.InvertedPortraitOrientation) {
81+ phoneStage.orientation = Qt.InvertedLandscapeOrientation;
83+ phoneStage.orientation = Qt.PortraitOrientation;
71 ListView {
88 ListView {
72 id: appList
89 id: appList
@@ -256,6 +273,46 @@ Item {
256 compare(ApplicationManager.focusedApplicationId, selectedApp.appId);
273 compare(ApplicationManager.focusedApplicationId, selectedApp.appId);
276+ function test_orientation_change_sent_to_focused_app() {
277+ phoneStage.orientation = Qt.PortraitOrientation;
280+ var spreadView = findChild(phoneStage, "spreadView");
281+ var app = findChild(spreadView, "appDelegate0");
282+ tryCompare(app, "orientation", Qt.PortraitOrientation);
284+ phoneStage.orientation = Qt.LandscapeOrientation;
285+ tryCompare(app, "orientation", Qt.LandscapeOrientation);
288+ function test_orientation_change_not_sent_to_apps_while_spread_open() {
289+ phoneStage.orientation = Qt.PortraitOrientation;
292+ var spreadView = findChild(phoneStage, "spreadView");
293+ var app = findChild(spreadView, "appDelegate0");
294+ tryCompare(app, "orientation", Qt.PortraitOrientation);
297+ phoneStage.orientation = Qt.LandscapeOrientation;
298+ tryCompare(app, "orientation", Qt.PortraitOrientation);
301+ function test_orientation_change_not_sent_to_unfocused_app_until_it_focused() {
302+ phoneStage.orientation = Qt.PortraitOrientation;
305+ var spreadView = findChild(phoneStage, "spreadView");
306+ var app = findChild(spreadView, "appDelegate0");
309+ phoneStage.orientation = Qt.LandscapeOrientation;
310+ tryCompare(app, "orientation", Qt.PortraitOrientation);
312+ phoneStage.select(app.application.appId);
313+ tryCompare(app, "orientation", Qt.LandscapeOrientation);
259 function cleanup() {
316 function cleanup() {
260 while (ApplicationManager.count > 1) {
317 while (ApplicationManager.count > 1) {
261 var oldCount = ApplicationManager.count;
318 var oldCount = ApplicationManager.count;
@@ -263,6 +320,7 @@ Item {
263 ApplicationManager.stopApplication(ApplicationManager.get(closingIndex).appId)
320 ApplicationManager.stopApplication(ApplicationManager.get(closingIndex).appId)
264 tryCompare(ApplicationManager, "count", oldCount - 1)
321 tryCompare(ApplicationManager, "count", oldCount - 1)
323+ phoneStage.orientation = Qt.PortraitOrientation;