on xenial help sign in
WIP - Move a bunch of properties into a Orientations container
c69bac9Daniel d'Andrada
qml/Components/Orientations.qmlnew file+29
@@ -0,0 +1,29 @@
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.3
18+
19+QtObject {
20+ // Just because "native" is a reserved keyword :(
21+ property int native_: Qt.PortraitOrientation
22+
23+ property int primary: Qt.PortraitOrientation
24+
25+ property int landscape: Qt.LandscapeOrientation
26+ property int invertedLandscape: Qt.InvertedLandscapeOrientation
27+ property int portrait: Qt.PortraitOrientation
28+ property int invertedPortrait: Qt.InvertedPortraitOrientation
29+}
qml/DeviceConfiguration.qml+82−76
@@ -16,93 +16,99 @@
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18
18
19−StateGroup {
19+QtObject {
20 id: root
20 id: root
21
21
22− readonly property int useNativeOrientation: -1
22+ readonly property int UseNativeOrientation: -1
23
23
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
25
27
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
34+
35+ readonly property alias category: "phone"
36+
37+ readonly property alias ignoredMice: 0
38+
39+ StateGroup {
40+ id: priv
41+
42+ property int primaryOrientation: root.UseNativeOrientation
43+
26− property int supportedOrientations: Qt.PortraitOrientation
44+ property int supportedOrientations: Qt.PortraitOrientation
27− | Qt.InvertedPortraitOrientation
45+ | Qt.InvertedPortraitOrientation
28− | Qt.LandscapeOrientation
46+ | Qt.LandscapeOrientation
29− | Qt.InvertedLandscapeOrientation
47+ | Qt.InvertedLandscapeOrientation
30
48
31− property var deviceSpecificOrientationOverrides: QtObject{
32− id: overrides
33 property int landscapeOrientation: Qt.LandscapeOrientation
49 property int landscapeOrientation: Qt.LandscapeOrientation
34 property int invertedLandscapeOrientation: Qt.InvertedLandscapeOrientation
50 property int invertedLandscapeOrientation: Qt.InvertedLandscapeOrientation
35 property int portraitOrientation: Qt.PortraitOrientation
51 property int portraitOrientation: Qt.PortraitOrientation
36 property int invertedPortraitOrientation: Qt.InvertedPortraitOrientation
52 property int invertedPortraitOrientation: Qt.InvertedPortraitOrientation
37− }
38−
39− // PropertyChanges don't like assigning to nested properties
40− property alias landscapeOrientation: overrides.landscapeOrientation
41− property alias invertedLandscapeOrientation: overrides.invertedLandscapeOrientation
42− property alias portraitOrientation: overrides.portraitOrientation
43− property alias invertedPortraitOrientation: overrides.invertedPortraitOrientation
44−
45− // Supported values so far:
46− // "phone", "tablet" or "desktop"
47− property string category: "phone"
48
53
49− property int ignoredMice: 0
54+ // Supported values so far:
55+ // "phone", "tablet" or "desktop"
56+ property string category: "phone"
50
57
58+ property int ignoredMice: 0
51
59
52− property alias name: root.state
53−
54− states: [
60+ states: [
55− State {
61+ State {
56− name: "mako"
62+ name: "mako"
57− PropertyChanges {
63+ PropertyChanges {
58− target: root
64+ target: priv
59− supportedOrientations: Qt.PortraitOrientation
65+ supportedOrientations: Qt.PortraitOrientation
60− | Qt.LandscapeOrientation
66+ | Qt.LandscapeOrientation
61− | Qt.InvertedLandscapeOrientation
67+ | Qt.InvertedLandscapeOrientation
62− }
68+ }
63− },
69+ },
64− State {
70+ State {
65− name: "krillin"
71+ name: "krillin"
66− PropertyChanges {
72+ PropertyChanges {
67− target: root
73+ target: priv
68− supportedOrientations: Qt.PortraitOrientation
74+ supportedOrientations: Qt.PortraitOrientation
69− | Qt.LandscapeOrientation
75+ | Qt.LandscapeOrientation
70− | Qt.InvertedLandscapeOrientation
76+ | Qt.InvertedLandscapeOrientation
71− }
77+ }
72− },
78+ },
73− State {
79+ State {
74− name: "arale"
80+ name: "arale"
75− PropertyChanges {
81+ PropertyChanges {
76− target: root
82+ target: priv
77− supportedOrientations: Qt.PortraitOrientation
83+ supportedOrientations: Qt.PortraitOrientation
78− | Qt.LandscapeOrientation
84+ | Qt.LandscapeOrientation
79− | Qt.InvertedLandscapeOrientation
85+ | Qt.InvertedLandscapeOrientation
80− ignoredMice: 1
86+ ignoredMice: 1
81− }
87+ }
82− },
88+ },
83− State {
89+ State {
84− name: "manta"
90+ name: "manta"
91+ PropertyChanges {
92+ target: priv
93+ category: "tablet"
94+ }
95+ },
96+ State {
97+ name: "flo"
85− PropertyChanges {
98+ PropertyChanges {
86− target: root
99+ target: priv
100+ landscapeOrientation: Qt.InvertedLandscapeOrientation
101+ primaryOrientation: Qt.InvertedLandscapeOrientation
87− category: "tablet"
102+ category: "tablet"
103+ }
104+ },
105+ State {
106+ name: "desktop"
107+ PropertyChanges {
108+ target: priv
109+ category: "desktop"
110+ }
88 }
111 }
89− },
90− State {
91− name: "flo"
92− PropertyChanges {
93− target: root
94− landscapeOrientation: Qt.InvertedLandscapeOrientation
95− primaryOrientation: Qt.InvertedLandscapeOrientation
96− category: "tablet"
97− }
98− },
99− State {
100− name: "desktop"
101− PropertyChanges {
102− target: root
103− category: "desktop"
104− }
105− }
106− ]
112+ ]
107−
113+ }
108}
114}
qml/OrientedShell.qml+24−18
@@ -32,18 +32,26 @@ Rectangle {
32 implicitWidth: units.gu(40)
32 implicitWidth: units.gu(40)
33 implicitHeight: units.gu(71)
33 implicitHeight: units.gu(71)
34
34
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−
42 DeviceConfiguration {
35 DeviceConfiguration {
43 id: deviceConfiguration
36 id: deviceConfiguration
44 name: applicationArguments.deviceName
37 name: applicationArguments.deviceName
45 }
38 }
46
39
40+ property var orientations: Orientations {
41+ id: orientations
42+ // NB: native and primary orientations here don't map exactly to their QScreen counterparts
43+ native_: root.width > root.height ? Qt.LandscapeOrientation : Qt.PortraitOrientation
44+
45+ primary: deviceConfiguration.primaryOrientation == deviceConfiguration.UseNativeOrientation
46+ ? nativeOrientation : deviceConfiguration.primaryOrientation
47+
48+ landscape: deviceConfiguration.landscapeOrientation
49+ invertedLandscape: deviceConfiguration.invertedLandscapeOrientation
50+ portrait: deviceConfiguration.portraitOrientation
51+ invertedPortrait: deviceConfiguration.invertedPortraitOrientation
52+ }
53+
54+
47
55
48 // to be overwritten by tests
56 // to be overwritten by tests
49 property var unity8Settings: Unity8Settings {}
57 property var unity8Settings: Unity8Settings {}
@@ -92,7 +100,7 @@ Rectangle {
92 & deviceConfiguration.supportedOrientations
100 & deviceConfiguration.supportedOrientations
93 property int acceptedOrientationAngle: {
101 property int acceptedOrientationAngle: {
94 if (orientation & supportedOrientations) {
102 if (orientation & supportedOrientations) {
95− return Screen.angleBetween(nativeOrientation, orientation);
103+ return Screen.angleBetween(orientations.native_, orientation);
96 } else if (shell.orientation & supportedOrientations) {
104 } else if (shell.orientation & supportedOrientations) {
97 // stay where we are
105 // stay where we are
98 return shell.orientationAngle;
106 return shell.orientationAngle;
@@ -102,16 +110,16 @@ Rectangle {
102 // rotate to some supported orientation as we can't stay where we currently are
110 // rotate to some supported orientation as we can't stay where we currently are
103 // TODO: Choose the closest to the current one
111 // TODO: Choose the closest to the current one
104 if (supportedOrientations & Qt.PortraitOrientation) {
112 if (supportedOrientations & Qt.PortraitOrientation) {
105− return Screen.angleBetween(nativeOrientation, Qt.PortraitOrientation);
113+ return Screen.angleBetween(orientations.native_, Qt.PortraitOrientation);
106− } else if (supportedOrientations & Qt.LandcscapeOrientation) {
114+ } else if (supportedOrientations & Qt.LandscapeOrientation) {
107− return Screen.angleBetween(nativeOrientation, Qt.LandscapeOrientation);
115+ return Screen.angleBetween(orientations.native_, Qt.LandscapeOrientation);
108 } else if (supportedOrientations & Qt.InvertedPortraitOrientation) {
116 } else if (supportedOrientations & Qt.InvertedPortraitOrientation) {
109− return Screen.angleBetween(nativeOrientation, Qt.InvertedPortraitOrientation);
117+ return Screen.angleBetween(orientations.native_, Qt.InvertedPortraitOrientation);
110 } else if (supportedOrientations & Qt.InvertedLandscapeOrientation) {
118 } else if (supportedOrientations & Qt.InvertedLandscapeOrientation) {
111− return Screen.angleBetween(nativeOrientation, Qt.InvertedLandscapeOrientation);
119+ return Screen.angleBetween(orientations.native_, Qt.InvertedLandscapeOrientation);
112 } else {
120 } else {
113 // if all fails, fallback to primary orientation
121 // if all fails, fallback to primary orientation
114− return Screen.angleBetween(nativeOrientation, primaryOrientation);
122+ return Screen.angleBetween(orientations.native_, orientations.primary);
115 }
123 }
116 }
124 }
117 }
125 }
@@ -135,7 +143,7 @@ Rectangle {
135 break;
143 break;
136 default:
144 default:
137 console.warn("angleToOrientation: Invalid orientation angle: " + angle);
145 console.warn("angleToOrientation: Invalid orientation angle: " + angle);
138− return primaryOrientation;
146+ return orientations.primary;
139 }
147 }
140 }
148 }
141
149
@@ -153,10 +161,8 @@ Rectangle {
153 objectName: "shell"
161 objectName: "shell"
154 width: root.width
162 width: root.width
155 height: root.height
163 height: root.height
156− deviceSpecificOrientationOverrides: deviceConfiguration.deviceSpecificOrientationOverrides
157 orientation: root.angleToOrientation(orientationAngle)
164 orientation: root.angleToOrientation(orientationAngle)
158− primaryOrientation: root.primaryOrientation
165+ orientations: root.orientations
159− nativeOrientation: root.nativeOrientation
160 nativeWidth: root.width
166 nativeWidth: root.width
161 nativeHeight: root.height
167 nativeHeight: root.height
162 mode: applicationArguments.mode
168 mode: applicationArguments.mode
qml/Shell.qml+5−17
@@ -48,9 +48,7 @@ Item {
48 // to be set from outside
48 // to be set from outside
49 property int orientationAngle: 0
49 property int orientationAngle: 0
50 property int orientation
50 property int orientation
51− property QtObject deviceSpecificOrientationOverrides
51+ property Orientations orientations
52− property int primaryOrientation
53− property int nativeOrientation
54 property real nativeWidth
52 property real nativeWidth
55 property real nativeHeight
53 property real nativeHeight
56 property alias indicatorAreaShowProgress: panel.indicatorAreaShowProgress
54 property alias indicatorAreaShowProgress: panel.indicatorAreaShowProgress
@@ -319,29 +317,19 @@ Item {
319 }
317 }
320 Binding {
318 Binding {
321 target: applicationsDisplayLoader.item
319 target: applicationsDisplayLoader.item
322− property: "background"
320+ property: "orientations"
323− value: shell.background
321+ value: shell.orientations
324− }
325− Binding {
326− target: applicationsDisplayLoader.item
327− property: "shellPrimaryOrientation"
328− value: shell.primaryOrientation
329 }
322 }
330 Binding {
323 Binding {
331 target: applicationsDisplayLoader.item
324 target: applicationsDisplayLoader.item
332− property: "nativeOrientation"
325+ property: "background"
333− value: shell.nativeOrientation
326+ value: shell.background
334 }
327 }
335 Binding {
328 Binding {
336 target: applicationsDisplayLoader.item
329 target: applicationsDisplayLoader.item
337 property: "nativeWidth"
330 property: "nativeWidth"
338 value: shell.nativeWidth
331 value: shell.nativeWidth
339 }
332 }
340− Binding {
341− target: applicationsDisplayLoader.item
342− property: "deviceSpecificOrientationOverrides"
343− value: shell.deviceSpecificOrientationOverrides
344− }
345 Binding {
333 Binding {
346 target: applicationsDisplayLoader.item
334 target: applicationsDisplayLoader.item
347 property: "nativeHeight"
335 property: "nativeHeight"
qml/Stages/DesktopStage.qml+2−2
@@ -21,6 +21,7 @@ import QtQuick.Layouts 1.1
21import Ubuntu.Components 1.1
21import Ubuntu.Components 1.1
22import Unity.Application 0.1
22import Unity.Application 0.1
23import "../Components/PanelState"
23import "../Components/PanelState"
24+import "../Components"
24import Utils 0.1
25import Utils 0.1
25import Ubuntu.Gestures 0.1
26import Ubuntu.Gestures 0.1
26
27
@@ -36,8 +37,7 @@ Rectangle {
36 property real inverseProgress: 0 // just to comply with the interface shared between stages
37 property real inverseProgress: 0 // just to comply with the interface shared between stages
37 property int shellOrientationAngle: 0
38 property int shellOrientationAngle: 0
38 property int shellOrientation
39 property int shellOrientation
39− property int shellPrimaryOrientation
40+ property Orientations orientations
40− property int nativeOrientation
41 property bool beingResized: false
41 property bool beingResized: false
42 property bool keepDashRunning: true
42 property bool keepDashRunning: true
43 property bool suspended: false
43 property bool suspended: false
qml/Stages/PhoneStage.qml+3−9
@@ -40,11 +40,8 @@ Rectangle {
40 property bool suspended: false
40 property bool suspended: false
41 property int shellOrientationAngle: 0
41 property int shellOrientationAngle: 0
42
42
43− // For some reason qml doesn't seem to like to bind to a QtObject, so this is a var
44− property var deviceSpecificOrientationOverrides
45 property int shellOrientation
43 property int shellOrientation
46− property int shellPrimaryOrientation
44+ property Orientations orientations
47− property int nativeOrientation
48 property real nativeWidth
45 property real nativeWidth
49 property real nativeHeight
46 property real nativeHeight
50 property bool beingResized: false
47 property bool beingResized: false
@@ -79,7 +76,7 @@ Rectangle {
79
76
80 var supportedOrientations = spreadDelegate.application.supportedOrientations;
77 var supportedOrientations = spreadDelegate.application.supportedOrientations;
81 if (supportedOrientations === Qt.PrimaryOrientation) {
78 if (supportedOrientations === Qt.PrimaryOrientation) {
82− supportedOrientations = spreadDelegate.shellPrimaryOrientation;
79+ supportedOrientations = root.orientations.primary;
83 }
80 }
84
81
85 if (delta === 180 && (supportedOrientations & spreadDelegate.shellOrientation)) {
82 if (delta === 180 && (supportedOrientations & spreadDelegate.shellOrientation)) {
@@ -530,12 +527,9 @@ Rectangle {
530 visible: (progress >= 0 && progress < 1.7)
527 visible: (progress >= 0 && progress < 1.7)
531 || (isDash && priv.focusedAppDelegateIsDislocated)
528 || (isDash && priv.focusedAppDelegateIsDislocated)
532
529
533−
534− deviceSpecificOrientationOverrides: root.deviceSpecificOrientationOverrides
535 shellOrientationAngle: root.shellOrientationAngle
530 shellOrientationAngle: root.shellOrientationAngle
536 shellOrientation: root.shellOrientation
531 shellOrientation: root.shellOrientation
537− shellPrimaryOrientation: root.shellPrimaryOrientation
532+ orientations: root.orientations
538− nativeOrientation: root.nativeOrientation
539
533
540 onClicked: {
534 onClicked: {
541 if (root.altTabEnabled && spreadView.phase == 2) {
535 if (root.altTabEnabled && spreadView.phase == 2) {
qml/Stages/SpreadDelegate.qml+8−15
@@ -42,9 +42,7 @@ FocusScope {
42 property alias application: appWindow.application
42 property alias application: appWindow.application
43 property int shellOrientationAngle
43 property int shellOrientationAngle
44 property int shellOrientation
44 property int shellOrientation
45− property QtObject deviceSpecificOrientationOverrides
45+ property Orientations orientations
46− property int shellPrimaryOrientation
47− property int nativeOrientation
48
46
49 function matchShellOrientation() {
47 function matchShellOrientation() {
50 if (!root.application)
48 if (!root.application)
@@ -140,7 +138,6 @@ FocusScope {
140 return angle % 360;
138 return angle % 360;
141 }
139 }
142
140
143− property alias overrides: root.deviceSpecificOrientationOverrides
144 states: [
141 states: [
145 // Sets the initial orientationAngle of the window, when it first slides into view
142 // Sets the initial orientationAngle of the window, when it first slides into view
146 // (with the splash screen likely being displayed). At that point we just try to
143 // (with the splash screen likely being displayed). At that point we just try to
@@ -159,7 +156,7 @@ FocusScope {
159 var supportedOrientations = root.application.supportedOrientations;
156 var supportedOrientations = root.application.supportedOrientations;
160
157
161 if (supportedOrientations === Qt.PrimaryOrientation) {
158 if (supportedOrientations === Qt.PrimaryOrientation) {
162− supportedOrientations = root.shellPrimaryOrientation;
159+ supportedOrientations = root.orientations.primary;
163 }
160 }
164
161
165 // If it doesn't support shell's current orientation
162 // If it doesn't support shell's current orientation
@@ -168,22 +165,18 @@ FocusScope {
168 if (supportedOrientations & root.shellOrientation) {
165 if (supportedOrientations & root.shellOrientation) {
169 chosenOrientation = root.shellOrientation;
166 chosenOrientation = root.shellOrientation;
170 } else if (supportedOrientations & Qt.PortraitOrientation) {
167 } else if (supportedOrientations & Qt.PortraitOrientation) {
171− chosenOrientation = overrides ?
168+ chosenOrientation = root.orientations.portrait;
172− overrides.portraitOrientation : Qt.PortraitOrientation;
173 } else if (supportedOrientations & Qt.LandscapeOrientation) {
169 } else if (supportedOrientations & Qt.LandscapeOrientation) {
174− chosenOrientation = overrides ?
170+ chosenOrientation = root.orientations.landscape;
175− overrides.landscapeOrientation : Qt.LandscapeOrientation;
176 } else if (supportedOrientations & Qt.InvertedPortraitOrientation) {
171 } else if (supportedOrientations & Qt.InvertedPortraitOrientation) {
177− chosenOrientation = overrides ?
172+ chosenOrientation = root.orientations.invertedPortrait;
178− overrides.invertedPortraitOrientation : Qt.InvertedPortraitOrientation;
179 } else if (supportedOrientations & Qt.InvertedLandscapeOrientation) {
173 } else if (supportedOrientations & Qt.InvertedLandscapeOrientation) {
180− chosenOrientation = overrides ?
174+ chosenOrientation = root.orientations.invertedLandscape;
181− overrides.invertedLandscapeOrientation : Qt.InvertedLandscapeOrientation;
182 } else {
175 } else {
183− chosenOrientation = root.shellPrimaryOrientation;
176+ chosenOrientation = root.orientations.primary;
184 }
177 }
185
178
186− return Screen.angleBetween(root.nativeOrientation, chosenOrientation);
179+ return Screen.angleBetween(root.orientations.native_, chosenOrientation);
187 }
180 }
188
181
189 rotation: normalizeAngle(appWindowWithShadow.orientationAngle - root.shellOrientationAngle)
182 rotation: normalizeAngle(appWindowWithShadow.orientationAngle - root.shellOrientationAngle)
qml/Stages/TabletStage.qml+11−6
@@ -43,8 +43,7 @@ Rectangle {
43 // For some reason qml doesn't seem to like to bind to a QtObject, so this is a var
43 // For some reason qml doesn't seem to like to bind to a QtObject, so this is a var
44 property var deviceSpecificOrientationOverrides
44 property var deviceSpecificOrientationOverrides
45 property int shellOrientation
45 property int shellOrientation
46− property int shellPrimaryOrientation
46+ property Orientations orientations
47− property int nativeOrientation
48 property real nativeWidth
47 property real nativeWidth
49 property real nativeHeight
48 property real nativeHeight
50
49
@@ -68,7 +67,7 @@ Rectangle {
68
67
69 var supportedOrientations = spreadDelegate.application.supportedOrientations;
68 var supportedOrientations = spreadDelegate.application.supportedOrientations;
70 if (supportedOrientations === Qt.PrimaryOrientation) {
69 if (supportedOrientations === Qt.PrimaryOrientation) {
71− supportedOrientations = spreadDelegate.shellPrimaryOrientation;
70+ supportedOrientations = spreadDelegate.orientations.primary;
72 }
71 }
73
72
74 if (delta === 180 && (supportedOrientations & spreadDelegate.shellOrientation)) {
73 if (delta === 180 && (supportedOrientations & spreadDelegate.shellOrientation)) {
@@ -134,7 +133,7 @@ Rectangle {
134 property string oldFocusedAppId: ""
133 property string oldFocusedAppId: ""
135 property bool mainAppOrientationChangesEnabled: false
134 property bool mainAppOrientationChangesEnabled: false
136
135
137− property real landscapeHeight: root.nativeOrientation == Qt.LandscapeOrientation ?
136+ property real landscapeHeight: root.orientations.native_ == Qt.LandscapeOrientation ?
138 root.nativeHeight : root.nativeWidth
137 root.nativeHeight : root.nativeWidth
139
138
140 property bool shellIsLandscape: root.shellOrientation === Qt.LandscapeOrientation
139 property bool shellIsLandscape: root.shellOrientation === Qt.LandscapeOrientation
@@ -696,8 +695,14 @@ Rectangle {
696 deviceSpecificOrientationOverrides: root.deviceSpecificOrientationOverrides
695 deviceSpecificOrientationOverrides: root.deviceSpecificOrientationOverrides
697 shellOrientationAngle: wantsMainStage ? root.shellOrientationAngle : 0
696 shellOrientationAngle: wantsMainStage ? root.shellOrientationAngle : 0
698 shellOrientation: wantsMainStage ? root.shellOrientation : Qt.PortraitOrientation
697 shellOrientation: wantsMainStage ? root.shellOrientation : Qt.PortraitOrientation
698+ orientations: Orientations {
699− shellPrimaryOrientation: wantsMainStage ? root.shellPrimaryOrientation : Qt.PortraitOrientation
699+ primary: spreadTile.wantsMainStage ? root.orientations.primary : Qt.PortraitOrientation
700− nativeOrientation: wantsMainStage ? root.nativeOrientation : Qt.PortraitOrientation
700+ native_: spreadTile.wantsMainStage ? root.orientations.native_ : Qt.PortraitOrientation
701+ portrait: root.orientations.portrait
702+ invertedPortrait: root.orientations.invertedPortrait
703+ landscape: root.orientations.landscape
704+ invertedLandscape: root.orientations.invertedLandscape
705+ }
701
706
702
707
703 onClicked: {
708 onClicked: {
tests/qmltests/Stages/tst_SpreadDelegate.qml+6−2
@@ -18,6 +18,7 @@ import QtQuick 2.0
18import QtTest 1.0
18import QtTest 1.0
19import Unity.Test 0.1 as UT
19import Unity.Test 0.1 as UT
20import ".."
20import ".."
21+import "../../../qml/Components"
21import "../../../qml/Stages"
22import "../../../qml/Stages"
22import Ubuntu.Components 0.1
23import Ubuntu.Components 0.1
23import Ubuntu.Components.ListItems 1.0 as ListItem
24import Ubuntu.Components.ListItems 1.0 as ListItem
@@ -73,8 +74,11 @@ Rectangle {
73 return Qt.LandscapeOrientation;
74 return Qt.LandscapeOrientation;
74 }
75 }
75 }
76 }
76− shellPrimaryOrientation: Qt.PortraitOrientation
77+
77− nativeOrientation: Qt.PortraitOrientation
78+ orientations: Orientations {
79+ // the default values will do
80+ }
81+
78 maximizedAppTopMargin: units.gu(3)
82 maximizedAppTopMargin: units.gu(3)
79 Component.onDestruction: {
83 Component.onDestruction: {
80 spreadDelegateLoader.itemDestroyed = true;
84 spreadDelegateLoader.itemDestroyed = true;