@@ -62,6 +62,22 @@ Item {
6262 property int failedLoginsDelayAttempts: 7 // number of failed logins
6363 property int failedLoginsDelaySeconds: 5 * 60 // seconds of forced waiting
6464
65+ property int orientation
66+ readonly property int deviceOrientationAngle: Screen.angleBetween(Screen.primaryOrientation, Screen.orientation)
67+ onDeviceOrientationAngleChanged: {
68+ if (!OrientationLock.enabled) {
69+ orientation = Screen.orientation;
70+ }
71+ }
72+ readonly property bool orientationLockEnabled: OrientationLock.enabled
73+ onOrientationLockEnabledChanged: {
74+ if (orientationLockEnabled) {
75+ OrientationLock.savedOrientation = Screen.orientation;
76+ } else {
77+ orientation = Screen.orientation;
78+ }
79+ }
80+
6581 function activateApplication(appId) {
6682 if (ApplicationManager.findApplication(appId)) {
6783 ApplicationManager.requestFocusApplication(appId);
@@ -86,6 +102,9 @@ Item {
86102
87103 Component.onCompleted: {
88104 Theme.name = "Ubuntu.Components.Themes.SuruGradient"
105+ if (orientationLockEnabled) {
106+ orientation = OrientationLock.savedOrientation;
107+ }
89108 }
90109
91110 GSettings {
@@ -171,18 +190,6 @@ Item {
171190 }
172191 }
173192
174− property int orientation
175− readonly property int deviceOrientation: Screen.angleBetween(Screen.primaryOrientation, Screen.orientation)
176− onDeviceOrientationChanged: {
177− if (!OrientationLock.enabled)
178− orientation = Screen.orientation;
179− }
180− readonly property bool orientationLockEnabled: OrientationLock.enabled
181− onOrientationLockEnabledChanged: {
182− if (!OrientationLock.enabled)
183− orientation = Screen.orientation;
184− }
185−
186193 Loader {
187194 id: applicationsDisplayLoader
188195 anchors.fill: parent