on xenial help sign in
Enable support for overriding application orientations based on device type Fixes: #1478637
commitc2d47ba492d291db38e31be3e91509ad6c263f9a authorMichał Sawicz <michal.sawicz@canonical.com> dateWed 4 Nov 2015, 14:57 (11 years ago) parentc61aeb54224c59
13 files changed+221−133
qml/Components/Orientations.qml+57 qml/DeviceConfiguration.qml+86−64 qml/OrientedShell.qml+34−24 qml/Shell.qml+6−12 qml/Stages/DesktopStage.qml+2−2 qml/Stages/PhoneStage.qml+4−6 qml/Stages/SpreadDelegate.qml+8−9 qml/Stages/TabletStage.qml+13−7 tests/qmltests/Stages/tst_PhoneStage.qml−2 tests/qmltests/Stages/tst_SpreadDelegate.qml+6−2 tests/qmltests/Stages/tst_TabletStage.qml+2−2 tests/qmltests/tst_OrientedShell.qml+1−1 tests/qmltests/tst_Shell.qml+2−2
qml/Components/Orientations.qmlnew file+57
@@ -0,0 +1,57 @@
1+/*
2+ * Copyright 2015 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+
19+QtObject {
20+ id: root
21+
22+ // Just because "native" is a reserved keyword :(
23+ property int native_: Qt.PortraitOrientation
24+
25+ property int primary: Qt.PortraitOrientation
26+
27+ property int landscape: Qt.LandscapeOrientation
28+ property int invertedLandscape: Qt.InvertedLandscapeOrientation
29+ property int portrait: Qt.PortraitOrientation
30+ property int invertedPortrait: Qt.InvertedPortraitOrientation
31+
32+ function map(orientations) {
33+ var result = 0;
34+
35+ if (orientations & Qt.PortraitOrientation) {
36+ result |= root.portrait;
37+ }
38+
39+ if (orientations & Qt.InvertedPortraitOrientation) {
40+ result |= root.invertedPortrait;
41+ }
42+
43+ if (orientations & Qt.LandscapeOrientation) {
44+ result |= root.landscape;
45+ }
46+
47+ if (orientations & Qt.InvertedLandscapeOrientation) {
48+ result |= root.invertedLandscape;
49+ }
50+
51+ if (result == 0) {
52+ result = root.primary;
53+ }
54+
55+ return result;
56+ }
57+}
qml/DeviceConfiguration.qml+86−64
@@ -16,79 +16,101 @@
1616
1717import QtQuick 2.4
1818
19−StateGroup {
19+QtObject {
2020 id: root
2121
2222 readonly property int useNativeOrientation: -1
2323
24− property int primaryOrientation: useNativeOrientation
24+ // The only writable property in the API
25+ // all other properties are set according to the device name
26+ property alias name: priv.state
2527
26− property int supportedOrientations: Qt.PortraitOrientation
27− | Qt.InvertedPortraitOrientation
28− | Qt.LandscapeOrientation
29− | Qt.InvertedLandscapeOrientation
28+ readonly property alias primaryOrientation: priv.primaryOrientation
29+ readonly property alias supportedOrientations: priv.supportedOrientations
30+ readonly property alias landscapeOrientation: priv.landscapeOrientation
31+ readonly property alias invertedLandscapeOrientation: priv.invertedLandscapeOrientation
32+ readonly property alias portraitOrientation: priv.portraitOrientation
33+ readonly property alias invertedPortraitOrientation: priv.invertedPortraitOrientation
3034
31− // Supported values so far:
32− // "phone", "tablet" or "desktop"
33− property string category: "phone"
35+ readonly property alias category: priv.category
3436
35− property int ignoredMice: 0
37+ readonly property alias ignoredMice: priv.ignoredMice
3638
39+ readonly property var priv: StateGroup {
40+ id: priv
3741
38− property alias name: root.state
42+ property int primaryOrientation: root.useNativeOrientation
3943
40− states: [
41− State {
42− name: "mako"
43− PropertyChanges {
44− target: root
45− supportedOrientations: Qt.PortraitOrientation
46− | Qt.LandscapeOrientation
47− | Qt.InvertedLandscapeOrientation
48− }
49− },
50− State {
51− name: "krillin"
52− PropertyChanges {
53− target: root
54− supportedOrientations: Qt.PortraitOrientation
55− | Qt.LandscapeOrientation
56− | Qt.InvertedLandscapeOrientation
57− }
58− },
59− State {
60− name: "arale"
61− PropertyChanges {
62− target: root
63− supportedOrientations: Qt.PortraitOrientation
64− | Qt.LandscapeOrientation
65− | Qt.InvertedLandscapeOrientation
66− ignoredMice: 1
67− }
68− },
69− State {
70− name: "manta"
71− PropertyChanges {
72− target: root
73− category: "tablet"
74− }
75− },
76− State {
77− name: "flo"
78− PropertyChanges {
79− target: root
80− primaryOrientation: Qt.InvertedLandscapeOrientation
81− category: "tablet"
82− }
83− },
84− State {
85− name: "desktop"
86− PropertyChanges {
87− target: root
88− category: "desktop"
89− supportedOrientations: root.useNativeOrientation
90− }
91− }
92− ]
44+ property int supportedOrientations: Qt.PortraitOrientation
45+ | Qt.InvertedPortraitOrientation
46+ | Qt.LandscapeOrientation
47+ | Qt.InvertedLandscapeOrientation
48+
49+ property int landscapeOrientation: Qt.LandscapeOrientation
50+ property int invertedLandscapeOrientation: Qt.InvertedLandscapeOrientation
51+ property int portraitOrientation: Qt.PortraitOrientation
52+ property int invertedPortraitOrientation: Qt.InvertedPortraitOrientation
53+
54+ // Supported values so far:
55+ // "phone", "tablet" or "desktop"
56+ property string category: "phone"
9357
58+ property int ignoredMice: 0
59+
60+ states: [
61+ State {
62+ name: "mako"
63+ PropertyChanges {
64+ target: priv
65+ supportedOrientations: Qt.PortraitOrientation
66+ | Qt.LandscapeOrientation
67+ | Qt.InvertedLandscapeOrientation
68+ }
69+ },
70+ State {
71+ name: "krillin"
72+ PropertyChanges {
73+ target: priv
74+ supportedOrientations: Qt.PortraitOrientation
75+ | Qt.LandscapeOrientation
76+ | Qt.InvertedLandscapeOrientation
77+ }
78+ },
79+ State {
80+ name: "arale"
81+ PropertyChanges {
82+ target: priv
83+ supportedOrientations: Qt.PortraitOrientation
84+ | Qt.LandscapeOrientation
85+ | Qt.InvertedLandscapeOrientation
86+ ignoredMice: 1
87+ }
88+ },
89+ State {
90+ name: "manta"
91+ PropertyChanges {
92+ target: priv
93+ category: "tablet"
94+ }
95+ },
96+ State {
97+ name: "flo"
98+ PropertyChanges {
99+ target: priv
100+ landscapeOrientation: Qt.InvertedLandscapeOrientation
101+ invertedLandscapeOrientation: Qt.LandscapeOrientation
102+ primaryOrientation: Qt.InvertedLandscapeOrientation
103+ category: "tablet"
104+ }
105+ },
106+ State {
107+ name: "desktop"
108+ PropertyChanges {
109+ target: priv
110+ category: "desktop"
111+ supportedOrientations: root.useNativeOrientation
112+ }
113+ }
114+ ]
115+ }
94116}
qml/OrientedShell.qml+34−24
@@ -32,20 +32,31 @@ Rectangle {
3232 implicitWidth: units.gu(40)
3333 implicitHeight: units.gu(71)
3434
35− // NB: native and primary orientations here don't map exactly to their QScreen counterparts
36− readonly property int nativeOrientation: width > height ? Qt.LandscapeOrientation : Qt.PortraitOrientation
37−
38− readonly property int primaryOrientation:
39− deviceConfiguration.primaryOrientation == deviceConfiguration.useNativeOrientation
40− ? nativeOrientation : deviceConfiguration.primaryOrientation
41−
4235 DeviceConfiguration {
4336 id: deviceConfiguration
4437 name: applicationArguments.deviceName
4538 }
4639
40+ property alias orientations: d.orientations
41+
42+ Item {
43+ id: d
44+
45+ property Orientations orientations: Orientations {
46+ id: orientations
47+ // NB: native and primary orientations here don't map exactly to their QScreen counterparts
48+ native_: root.width > root.height ? Qt.LandscapeOrientation : Qt.PortraitOrientation
4749
48− // to be overwritten by tests
50+ primary: deviceConfiguration.primaryOrientation == deviceConfiguration.useNativeOrientation
51+ ? native_ : deviceConfiguration.primaryOrientation
52+
53+ landscape: deviceConfiguration.landscapeOrientation
54+ invertedLandscape: deviceConfiguration.invertedLandscapeOrientation
55+ portrait: deviceConfiguration.portraitOrientation
56+ invertedPortrait: deviceConfiguration.invertedPortraitOrientation
57+ }
58+ }
59+ // to be overwritten by tests
4960 property var unity8Settings: Unity8Settings {}
5061 property var oskSettings: GSettings { schema.id: "com.canonical.keyboard.maliit" }
5162
@@ -78,8 +89,8 @@ Rectangle {
7889
7990 // we must rotate to a supported orientation regardless of shell's preference
8091 property bool orientationChangesEnabled:
81− (orientation & supportedOrientations) === 0 ? true
82− : shell.orientationChangesEnabled
92+ (shell.orientation & supportedOrientations) === 0 ? true
93+ : shell.orientationChangesEnabled
8394
8495
8596 Binding {
@@ -96,12 +107,12 @@ Rectangle {
96107
97108 readonly property int supportedOrientations: shell.supportedOrientations
98109 & (deviceConfiguration.supportedOrientations == deviceConfiguration.useNativeOrientation
99− ? nativeOrientation
110+ ? orientations.native_
100111 : deviceConfiguration.supportedOrientations)
101112
102113 property int acceptedOrientationAngle: {
103114 if (orientation & supportedOrientations) {
104− return Screen.angleBetween(nativeOrientation, orientation);
115+ return Screen.angleBetween(orientations.native_, orientation);
105116 } else if (shell.orientation & supportedOrientations) {
106117 // stay where we are
107118 return shell.orientationAngle;
@@ -111,16 +122,16 @@ Rectangle {
111122 // rotate to some supported orientation as we can't stay where we currently are
112123 // TODO: Choose the closest to the current one
113124 if (supportedOrientations & Qt.PortraitOrientation) {
114− return Screen.angleBetween(nativeOrientation, Qt.PortraitOrientation);
125+ return Screen.angleBetween(orientations.native_, Qt.PortraitOrientation);
115126 } else if (supportedOrientations & Qt.LandscapeOrientation) {
116− return Screen.angleBetween(nativeOrientation, Qt.LandscapeOrientation);
127+ return Screen.angleBetween(orientations.native_, Qt.LandscapeOrientation);
117128 } else if (supportedOrientations & Qt.InvertedPortraitOrientation) {
118− return Screen.angleBetween(nativeOrientation, Qt.InvertedPortraitOrientation);
129+ return Screen.angleBetween(orientations.native_, Qt.InvertedPortraitOrientation);
119130 } else if (supportedOrientations & Qt.InvertedLandscapeOrientation) {
120− return Screen.angleBetween(nativeOrientation, Qt.InvertedLandscapeOrientation);
131+ return Screen.angleBetween(orientations.native_, Qt.InvertedLandscapeOrientation);
121132 } else {
122133 // if all fails, fallback to primary orientation
123− return Screen.angleBetween(nativeOrientation, primaryOrientation);
134+ return Screen.angleBetween(orientations.native_, orientations.primary);
124135 }
125136 }
126137 }
@@ -128,19 +139,19 @@ Rectangle {
128139 function angleToOrientation(angle) {
129140 switch (angle) {
130141 case 0:
131− return nativeOrientation;
142+ return orientations.native_;
132143 case 90:
133− return nativeOrientation === Qt.PortraitOrientation ? Qt.InvertedLandscapeOrientation
144+ return orientations.native_ === Qt.PortraitOrientation ? Qt.InvertedLandscapeOrientation
134145 : Qt.PortraitOrientation;
135146 case 180:
136− return nativeOrientation === Qt.PortraitOrientation ? Qt.InvertedPortraitOrientation
147+ return orientations.native_ === Qt.PortraitOrientation ? Qt.InvertedPortraitOrientation
137148 : Qt.InvertedLandscapeOrientation;
138149 case 270:
139− return nativeOrientation === Qt.PortraitOrientation ? Qt.LandscapeOrientation
150+ return orientations.native_ === Qt.PortraitOrientation ? Qt.LandscapeOrientation
140151 : Qt.InvertedPortraitOrientation;
141152 default:
142153 console.warn("angleToOrientation: Invalid orientation angle: " + angle);
143− return primaryOrientation;
154+ return orientations.primary;
144155 }
145156 }
146157
@@ -159,8 +170,7 @@ Rectangle {
159170 width: root.width
160171 height: root.height
161172 orientation: root.angleToOrientation(orientationAngle)
162− primaryOrientation: root.primaryOrientation
163− nativeOrientation: root.nativeOrientation
173+ orientations: root.orientations
164174 nativeWidth: root.width
165175 nativeHeight: root.height
166176 mode: applicationArguments.mode
qml/Shell.qml+6−12
@@ -49,8 +49,7 @@ Item {
4949 // to be set from outside
5050 property int orientationAngle: 0
5151 property int orientation
52− property int primaryOrientation
53− property int nativeOrientation
52+ property Orientations orientations
5453 property real nativeWidth
5554 property real nativeHeight
5655 property alias indicatorAreaShowProgress: panel.indicatorAreaShowProgress
@@ -86,7 +85,7 @@ Item {
8685 } else if (greeter && greeter.shown) {
8786 return Qt.PrimaryOrientation;
8887 } else if (mainApp) {
89− return mainApp.supportedOrientations;
88+ return shell.orientations.map(mainApp.supportedOrientations);
9089 } else {
9190 // we just don't care
9291 return Qt.PortraitOrientation
@@ -299,18 +298,13 @@ Item {
299298 }
300299 Binding {
301300 target: applicationsDisplayLoader.item
302− property: "background"
303− value: wallpaperResolver.background
301+ property: "orientations"
302+ value: shell.orientations
304303 }
305304 Binding {
306305 target: applicationsDisplayLoader.item
307− property: "shellPrimaryOrientation"
308− value: shell.primaryOrientation
309− }
310− Binding {
311− target: applicationsDisplayLoader.item
312− property: "nativeOrientation"
313− value: shell.nativeOrientation
306+ property: "background"
307+ value: wallpaperResolver.background
314308 }
315309 Binding {
316310 target: applicationsDisplayLoader.item
qml/Stages/DesktopStage.qml+2−2
@@ -22,6 +22,7 @@ import Ubuntu.Components 1.3
2222import Unity.Application 0.1
2323import "../Components"
2424import "../Components/PanelState"
25+import "../Components"
2526import Utils 0.1
2627import Ubuntu.Gestures 0.1
2728
@@ -37,8 +38,7 @@ Rectangle {
3738 property real inverseProgress: 0 // just to comply with the interface shared between stages
3839 property int shellOrientationAngle: 0
3940 property int shellOrientation
40− property int shellPrimaryOrientation
41− property int nativeOrientation
41+ property QtObject orientations
4242 property bool beingResized: false
4343 property bool keepDashRunning: true
4444 property bool suspended: false
qml/Stages/PhoneStage.qml+4−6
@@ -39,9 +39,9 @@ Rectangle {
3939 property bool keepDashRunning: true
4040 property bool suspended: false
4141 property int shellOrientationAngle: 0
42+
4243 property int shellOrientation
43− property int shellPrimaryOrientation
44− property int nativeOrientation
44+ property QtObject orientations
4545 property real nativeWidth
4646 property real nativeHeight
4747 property bool beingResized: false
@@ -71,7 +71,7 @@ Rectangle {
7171
7272 var supportedOrientations = spreadDelegate.application.supportedOrientations;
7373 if (supportedOrientations === Qt.PrimaryOrientation) {
74− supportedOrientations = spreadDelegate.shellPrimaryOrientation;
74+ supportedOrientations = root.orientations.primary;
7575 }
7676
7777 if (delta === 180 && (supportedOrientations & spreadDelegate.shellOrientation)) {
@@ -535,11 +535,9 @@ Rectangle {
535535 visible: (progress >= 0 && progress < 1.7)
536536 || (isDash && priv.focusedAppDelegateIsDislocated)
537537
538−
539538 shellOrientationAngle: root.shellOrientationAngle
540539 shellOrientation: root.shellOrientation
541− shellPrimaryOrientation: root.shellPrimaryOrientation
542− nativeOrientation: root.nativeOrientation
540+ orientations: root.orientations
543541
544542 onClicked: {
545543 if (root.altTabEnabled && spreadView.phase == 2) {
qml/Stages/SpreadDelegate.qml+8−9
@@ -42,8 +42,7 @@ FocusScope {
4242 property alias application: appWindow.application
4343 property int shellOrientationAngle
4444 property int shellOrientation
45− property int shellPrimaryOrientation
46− property int nativeOrientation
45+ property QtObject orientations
4746
4847 function matchShellOrientation() {
4948 if (!root.application)
@@ -157,7 +156,7 @@ FocusScope {
157156 var supportedOrientations = root.application.supportedOrientations;
158157
159158 if (supportedOrientations === Qt.PrimaryOrientation) {
160− supportedOrientations = root.shellPrimaryOrientation;
159+ supportedOrientations = root.orientations.primary;
161160 }
162161
163162 // If it doesn't support shell's current orientation
@@ -166,18 +165,18 @@ FocusScope {
166165 if (supportedOrientations & root.shellOrientation) {
167166 chosenOrientation = root.shellOrientation;
168167 } else if (supportedOrientations & Qt.PortraitOrientation) {
169− chosenOrientation = Qt.PortraitOrientation;
168+ chosenOrientation = root.orientations.portrait;
170169 } else if (supportedOrientations & Qt.LandscapeOrientation) {
171− chosenOrientation = Qt.LandscapeOrientation;
170+ chosenOrientation = root.orientations.landscape;
172171 } else if (supportedOrientations & Qt.InvertedPortraitOrientation) {
173− chosenOrientation = Qt.InvertedPortraitOrientation;
172+ chosenOrientation = root.orientations.invertedPortrait;
174173 } else if (supportedOrientations & Qt.InvertedLandscapeOrientation) {
175− chosenOrientation = Qt.InvertedLandscapeOrientation;
174+ chosenOrientation = root.orientations.invertedLandscape;
176175 } else {
177− chosenOrientation = root.shellPrimaryOrientation;
176+ chosenOrientation = root.orientations.primary;
178177 }
179178
180− return Screen.angleBetween(root.nativeOrientation, chosenOrientation);
179+ return Screen.angleBetween(root.orientations.native_, chosenOrientation);
181180 }
182181
183182 rotation: normalizeAngle(appWindowWithShadow.orientationAngle - root.shellOrientationAngle)
qml/Stages/TabletStage.qml+13−7
@@ -39,11 +39,12 @@ Rectangle {
3939 property bool keepDashRunning: true
4040 property bool suspended: false
4141 property int shellOrientationAngle: 0
42+
4243 property int shellOrientation
43− property int shellPrimaryOrientation
44− property int nativeOrientation
44+ property QtObject orientations
4545 property real nativeWidth
4646 property real nativeHeight
47+
4748 function updateFocusedAppOrientation() {
4849 var mainStageAppIndex = priv.indexOf(priv.mainStageAppId);
4950 if (mainStageAppIndex >= 0 && mainStageAppIndex < spreadRepeater.count) {
@@ -64,7 +65,7 @@ Rectangle {
6465
6566 var supportedOrientations = spreadDelegate.application.supportedOrientations;
6667 if (supportedOrientations === Qt.PrimaryOrientation) {
67− supportedOrientations = spreadDelegate.shellPrimaryOrientation;
68+ supportedOrientations = spreadDelegate.orientations.primary;
6869 }
6970
7071 if (delta === 180 && (supportedOrientations & spreadDelegate.shellOrientation)) {
@@ -130,7 +131,7 @@ Rectangle {
130131 property string oldFocusedAppId: ""
131132 property bool mainAppOrientationChangesEnabled: false
132133
133− property real landscapeHeight: root.nativeOrientation == Qt.LandscapeOrientation ?
134+ property real landscapeHeight: root.orientations.native_ == Qt.LandscapeOrientation ?
134135 root.nativeHeight : root.nativeWidth
135136
136137 property bool shellIsLandscape: root.shellOrientation === Qt.LandscapeOrientation
@@ -691,9 +692,14 @@ Rectangle {
691692
692693 shellOrientationAngle: wantsMainStage ? root.shellOrientationAngle : 0
693694 shellOrientation: wantsMainStage ? root.shellOrientation : Qt.PortraitOrientation
694− shellPrimaryOrientation: wantsMainStage ? root.shellPrimaryOrientation : Qt.PortraitOrientation
695− nativeOrientation: wantsMainStage ? root.nativeOrientation : Qt.PortraitOrientation
696−
695+ orientations: Orientations {
696+ primary: spreadTile.wantsMainStage ? root.orientations.primary : Qt.PortraitOrientation
697+ native_: spreadTile.wantsMainStage ? root.orientations.native_ : Qt.PortraitOrientation
698+ portrait: root.orientations.portrait
699+ invertedPortrait: root.orientations.invertedPortrait
700+ landscape: root.orientations.landscape
701+ invertedLandscape: root.orientations.invertedLandscape
702+ }
697703
698704 onClicked: {
699705 if (spreadView.phase == 2) {
tests/qmltests/Stages/tst_PhoneStage.qml−2
@@ -34,8 +34,6 @@ Item {
3434 maximizedAppTopMargin: units.gu(3) + units.dp(2)
3535 interactive: true
3636 shellOrientation: Qt.PortraitOrientation
37− shellPrimaryOrientation: Qt.PortraitOrientation
38− nativeOrientation: Qt.PortraitOrientation
3937 }
4038
4139 Binding {
tests/qmltests/Stages/tst_SpreadDelegate.qml+6−2
@@ -18,6 +18,7 @@ import QtQuick 2.4
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import ".."
21+import "../../../qml/Components"
2122import "../../../qml/Stages"
2223import Ubuntu.Components 1.3
2324import Ubuntu.Components.ListItems 1.3 as ListItem
@@ -73,8 +74,11 @@ Rectangle {
7374 return Qt.LandscapeOrientation;
7475 }
7576 }
76− shellPrimaryOrientation: Qt.PortraitOrientation
77− nativeOrientation: Qt.PortraitOrientation
77+
78+ orientations: Orientations {
79+ // the default values will do
80+ }
81+
7882 maximizedAppTopMargin: units.gu(3)
7983 Component.onDestruction: {
8084 spreadDelegateLoader.itemDestroyed = true;
tests/qmltests/Stages/tst_TabletStage.qml+2−2
@@ -22,6 +22,7 @@ import Unity.Application 0.1
2222import Unity.Test 0.1
2323
2424import "../../../qml/Stages"
25+import "../../../qml/Components"
2526
2627Rectangle {
2728 id: root
@@ -50,10 +51,9 @@ Rectangle {
5051 maximizedAppTopMargin: units.gu(3) + units.dp(2)
5152 interactive: true
5253 shellOrientation: Qt.LandscapeOrientation
53− shellPrimaryOrientation: Qt.LandscapeOrientation
54− nativeOrientation: Qt.LandscapeOrientation
5554 nativeWidth: width
5655 nativeHeight: height
56+ orientations: Orientations{} // Defaults are fine for testing
5757 focus: true
5858 }
5959 }
tests/qmltests/tst_OrientedShell.qml+1−1
@@ -840,7 +840,7 @@ Rectangle {
840840 // shell should remain in its primery orientation as the app in the main stage
841841 // is the one that dictates its orientation. In this case it's unity8-dash
842842 // which supports only primary orientation
843− compare(shell.orientation, orientedShell.primaryOrientation);
843+ compare(shell.orientation, orientedShell.orientations.primary);
844844 }
845845
846846 function test_sideStageAppsRemainPortraitInSpread_data() {
tests/qmltests/tst_Shell.qml+2−2
@@ -32,6 +32,7 @@ import Wizard 0.1 as Wizard
3232import Utils 0.1
3333
3434import "../../qml"
35+import "../../qml/Components"
3536import "../../qml/Components/PanelState"
3637import "Stages"
3738
@@ -99,8 +100,7 @@ Rectangle {
99100 id: __shell
100101 usageScenario: usageScenarioSelector.model[usageScenarioSelector.selectedIndex]
101102 orientation: Qt.PortraitOrientation
102− primaryOrientation: Qt.PortraitOrientation
103− nativeOrientation: Qt.PortraitOrientation
103+ orientations: Orientations{} // Defaults are fine for testing
104104 Component.onDestruction: {
105105 shellLoader.itemDestroyed = true;
106106 }