on xenial help sign in
Replace OrientationHelper as it seems to confuse Qt's internal geometry calculations
commitccf5cfe4595fc12eb440879a38048b67629f3cf7 authorGerry Boland <gerry.boland@canonical.com> dateWed 19 Feb 2014, 17:27 (13 years ago) parent9f11428
2 files changed+8−6
qml/Shell.qml+1 qml/ShellOrientator.qml+7−6
qml/Shell.qml+1
@@ -37,6 +37,7 @@ import Unity.Notifications 1.0 as NotificationBackend
3737
3838FocusScope {
3939 id: shell
40+ objectName: "shell"
4041
4142 // this is only here to select the width / height of the window if not running fullscreen
4243 property bool tablet: false
qml/ShellOrientator.qml+7−6
@@ -16,7 +16,6 @@
1616
1717import QtQuick 2.0
1818import QtQuick.Window 2.0
19−import Ubuntu.Components 0.1
2019import Unity.Application 0.1
2120
2221Item {
@@ -27,12 +26,14 @@ Item {
2726 width: tablet ? units.gu(160) : applicationArguments.hasGeometry() ? applicationArguments.width() : units.gu(40)
2827 height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
2928
30− OrientationHelper {
31− orientationAngle: Screen.angleBetween(nativeOrientation, Screen.primaryOrientation)
32− transitionEnabled: false
29+ Item {
30+ anchors.fill: parent
31+ rotation: Screen.angleBetween(nativeOrientation, Screen.primaryOrientation)
3332 Shell {
34− id: shell
35− anchors.fill: parent
33+ x: (rotation != 0) ? 0 : (parent.width - parent.height) / 2
34+ y: (rotation != 0) ? 0 : -(parent.width - parent.height) / 2
35+ width: (rotation != 0) ? parent.width : parent.height
36+ height: (rotation != 0) ? parent.height : parent.width
3637 }
3738 }
3839