on xenial help sign in
simplify rotation code
434e279Michael Zanetti
qml/DisabledScreenNotice.qml+4−9
@@ -36,10 +36,10 @@ Item {
36 Item {
36 Item {
37 id: contentContainer
37 id: contentContainer
38 anchors.centerIn: parent
38 anchors.centerIn: parent
39− height: rotationAngle == 90 || rotationAngle == 270 ? parent.width : parent.height
39+ height: rotation == 90 || rotation == 270 ? parent.width : parent.height
40− width: rotationAngle == 90 || rotationAngle == 270 ? parent.height : parent.width
40+ width: rotation == 90 || rotation == 270 ? parent.height : parent.width
41
41
42− readonly property int rotationAngle: {
42+ rotation: {
43 switch (Screen.orientation) {
43 switch (Screen.orientation) {
44 case Qt.PortraitOrientation:
44 case Qt.PortraitOrientation:
45 return 0;
45 return 0;
@@ -51,12 +51,7 @@ Item {
51 return 90;
51 return 90;
52 }
52 }
53 }
53 }
54−
54+ transformOrigin: Item.Center
55− transform: Rotation {
56− origin.x: contentContainer.width / 2
57− origin.y: contentContainer.height / 2; axis { x: 0; y: 0; z: 1 }
58− angle: contentContainer.rotationAngle
59− }
60
55
61 VirtualTouchPad {
56 VirtualTouchPad {
62 anchors.fill: parent
57 anchors.fill: parent