on xenial help sign in
fix app rotation restrictions
4432516Michael Zanetti
qml/Stage/Stage.qml+24
@@ -56,6 +56,30 @@ AbstractStage {
56
56
57 orientationChangesEnabled: true
57 orientationChangesEnabled: true
58
58
59+ supportedOrientations: {
60+ if (mainApp) {
61+ switch (mode) {
62+ case "staged":
63+ return mainApp.supportedOrientations;
64+ case "stagedWithSideStage":
65+ var orientations = mainApp.supportedOrientations;
66+ orientations |= Qt.LandscapeOrientation | Qt.InvertedLandscapeOrientation;
67+ if (priv.sideStageItemId && !spreadView.surfaceDragging) {
68+ // If we have a sidestage app, support Portrait orientation
69+ // so that it will switch the sidestage app to mainstage on rotate to portrait
70+ orientations |= Qt.PortraitOrientation|Qt.InvertedPortraitOrientation;
71+ }
72+ return orientations;
73+ }
74+ }
75+
76+ return Qt.PortraitOrientation |
77+ Qt.LandscapeOrientation |
78+ Qt.InvertedPortraitOrientation |
79+ Qt.InvertedLandscapeOrientation;
80+ }
81+
82+
59 onAltTabPressedChanged: priv.goneToSpread = altTabPressed
83 onAltTabPressedChanged: priv.goneToSpread = altTabPressed
60
84
61 GlobalShortcut {
85 GlobalShortcut {