on xenial help sign in
fix app rotation restrictions
commit4432516ab6d783f82a8a9c28416755799aa650df authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 8 Sep 2016, 14:30 (10 years ago) parent16d9a38
1 file changed+24
qml/Stage/Stage.qml+24
qml/Stage/Stage.qml+24
@@ -56,6 +56,30 @@ AbstractStage {
5656
5757 orientationChangesEnabled: true
5858
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+
5983 onAltTabPressedChanged: priv.goneToSpread = altTabPressed
6084
6185 GlobalShortcut {