on xenial help sign in
Desktop stage rotates only to follow screen orientation
a73b099Daniel d'Andrada
qml/Shell.qml+3−3
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2013-2015 Canonical, Ltd.
2+ * Copyright (C) 2013-2016 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU General Public License as published by
@@ -84,8 +84,8 @@ Item {
84 return Qt.PrimaryOrientation;
84 return Qt.PrimaryOrientation;
85 } else if (greeter && greeter.shown) {
85 } else if (greeter && greeter.shown) {
86 return Qt.PrimaryOrientation;
86 return Qt.PrimaryOrientation;
87− } else if (mainApp) {
87+ } else if (applicationsDisplayLoader.item) {
88− return shell.orientations.map(mainApp.supportedOrientations);
88+ return shell.orientations.map(applicationsDisplayLoader.item.supportedOrientations);
89 } else {
89 } else {
90 // we just don't care
90 // we just don't care
91 return Qt.PortraitOrientation
91 return Qt.PortraitOrientation
qml/Stages/AbstractStage.qml+5−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2015 Canonical, Ltd.
2+ * Copyright (C) 2015-2016 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU General Public License as published by
@@ -44,6 +44,10 @@ Rectangle {
44 property var mainApp: null
44 property var mainApp: null
45 property int mainAppWindowOrientationAngle
45 property int mainAppWindowOrientationAngle
46 property bool orientationChangesEnabled
46 property bool orientationChangesEnabled
47+ property int supportedOrientations: Qt.PortraitOrientation
48+ | Qt.LandscapeOrientation
49+ | Qt.InvertedPortraitOrientation
50+ | Qt.InvertedLandscapeOrientation
47
51
48 // Shared code for use in stage implementations
52 // Shared code for use in stage implementations
49 GSettings {
53 GSettings {
qml/Stages/DesktopStage.qml+6−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2014-2015 Canonical, Ltd.
2+ * Copyright (C) 2014-2016 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU General Public License as published by
@@ -40,6 +40,11 @@ AbstractStage {
40 ? ApplicationManager.findApplication(ApplicationManager.focusedApplicationId)
40 ? ApplicationManager.findApplication(ApplicationManager.focusedApplicationId)
41 : null
41 : null
42
42
43+ // application windows never rotate independently
44+ mainAppWindowOrientationAngle: shellOrientationAngle
45+
46+ orientationChangesEnabled: true
47+
43 Connections {
48 Connections {
44 target: ApplicationManager
49 target: ApplicationManager
45 onApplicationAdded: {
50 onApplicationAdded: {
qml/Stages/PhoneStage.qml+5−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2014-2015 Canonical, Ltd.
2+ * Copyright (C) 2014-2016 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU General Public License as published by
@@ -83,6 +83,10 @@ AbstractStage {
83 && !(priv.focusedAppDelegate && priv.focusedAppDelegate.xBehavior.running)
83 && !(priv.focusedAppDelegate && priv.focusedAppDelegate.xBehavior.running)
84 && spreadView.phase === 0
84 && spreadView.phase === 0
85
85
86+ supportedOrientations: mainApp ? mainApp.supportedOrientations
87+ : (Qt.PortraitOrientation | Qt.LandscapeOrientation
88+ | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation)
89+
86 // How far left the stage has been dragged
90 // How far left the stage has been dragged
87 readonly property real dragProgress: spreadRepeater.count > 0 ? -spreadRepeater.itemAt(0).xTranslate : 0
91 readonly property real dragProgress: spreadRepeater.count > 0 ? -spreadRepeater.itemAt(0).xTranslate : 0
88
92
qml/Stages/TabletStage.qml+5−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2014-2015 Canonical, Ltd.
2+ * Copyright (C) 2014-2016 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU General Public License as published by
@@ -72,6 +72,10 @@ AbstractStage {
72
72
73 orientationChangesEnabled: priv.mainAppOrientationChangesEnabled
73 orientationChangesEnabled: priv.mainAppOrientationChangesEnabled
74
74
75+ supportedOrientations: mainApp ? mainApp.supportedOrientations
76+ : (Qt.PortraitOrientation | Qt.LandscapeOrientation
77+ | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation)
78+
75 onWidthChanged: {
79 onWidthChanged: {
76 spreadView.selectedIndex = -1;
80 spreadView.selectedIndex = -1;
77 spreadView.phase = 0;
81 spreadView.phase = 0;