on xenial help sign in
Change Orientations object to QtObject so binding doesn't segv
commit12ab1f6f5bb14a8d1a9238023b2b0300849f7d5b authorJosh Arenson <joshua.arenson@canonical.com> dateFri 25 Sep 2015, 11:19 (11 years ago) parentb4b4c49
5 files changed+8−9
qml/OrientedShell.qml+4−3 qml/Stages/DesktopStage.qml+1−1 qml/Stages/PhoneStage.qml+1−1 qml/Stages/SpreadDelegate.qml+1−1 qml/Stages/TabletStage.qml+1−3
qml/OrientedShell.qml+4−3
@@ -37,8 +37,9 @@ Rectangle {
3737 name: applicationArguments.deviceName
3838 }
3939
40− property var orientations: Orientations {
41− id: orientations
40+ property alias orientations: orientations_
41+ Orientations {
42+ id: orientations_
4243 // NB: native and primary orientations here don't map exactly to their QScreen counterparts
4344 native_: root.width > root.height ? Qt.LandscapeOrientation : Qt.PortraitOrientation
4445
@@ -158,7 +159,7 @@ Rectangle {
158159 width: root.width
159160 height: root.height
160161 orientation: root.angleToOrientation(orientationAngle)
161− orientations: root.orientations
162+ orientations: root.orientations ? root.orientations : ""
162163 nativeWidth: root.width
163164 nativeHeight: root.height
164165 mode: applicationArguments.mode
qml/Stages/DesktopStage.qml+1−1
@@ -37,7 +37,7 @@ Rectangle {
3737 property real inverseProgress: 0 // just to comply with the interface shared between stages
3838 property int shellOrientationAngle: 0
3939 property int shellOrientation
40− property Orientations orientations
40+ property QtObject orientations
4141 property bool beingResized: false
4242 property bool keepDashRunning: true
4343 property bool suspended: false
qml/Stages/PhoneStage.qml+1−1
@@ -41,7 +41,7 @@ Rectangle {
4141 property int shellOrientationAngle: 0
4242
4343 property int shellOrientation
44− property Orientations orientations
44+ property QtObject orientations
4545 property real nativeWidth
4646 property real nativeHeight
4747 property bool beingResized: false
qml/Stages/SpreadDelegate.qml+1−1
@@ -42,7 +42,7 @@ FocusScope {
4242 property alias application: appWindow.application
4343 property int shellOrientationAngle
4444 property int shellOrientation
45− property Orientations orientations
45+ property QtObject orientations
4646
4747 function matchShellOrientation() {
4848 if (!root.application)
qml/Stages/TabletStage.qml+1−3
@@ -40,10 +40,8 @@ Rectangle {
4040 property bool suspended: false
4141 property int shellOrientationAngle: 0
4242
43− // For some reason qml doesn't seem to like to bind to a QtObject, so this is a var
44− property var deviceSpecificOrientationOverrides
4543 property int shellOrientation
46− property Orientations orientations
44+ property QtObject orientations
4745 property real nativeWidth
4846 property real nativeHeight
4947