on xenial help sign in
MockMirSurfaceItem: Rotate whole thing, even if image looks weird
ef8d877Gerry Boland
tests/mocks/Unity/Application/MirSurfaceItem.qml+11−8
@@ -21,11 +21,20 @@ Rectangle {
21 id: root
21 id: root
22 color: "pink"
22 color: "pink"
23
23
24− anchors.fill: parent
25−
26 implicitWidth: units.gu(40)
24 implicitWidth: units.gu(40)
27 implicitHeight: units.gu(70)
25 implicitHeight: units.gu(70)
28
26
27+ rotation: {
28+ if (orientation == Qt.PortraitOrientation) return 0;
29+ else if (orientation == Qt.LandscapeOrientation) return 90;
30+ else if (orientation == Qt.InvertedPortraitOrientation) return 180;
31+ else return 270;
32+ }
33+ x: parent ? (parent.width - width) / 2 : 0
34+ y: parent ? (parent.height - height) / 2 : 0
35+ width: parent ? (rotation == 0 || rotation == 180 ? parent.width : parent.height) : implicitWidth
36+ height: parent ? (rotation == 0 || rotation == 180 ? parent.height : parent.width) : implicitHeight
37+
29 property alias screenshotSource: screenshotImage.source
38 property alias screenshotSource: screenshotImage.source
30 property int orientation: Qt.PortraitOrientation
39 property int orientation: Qt.PortraitOrientation
31
40
@@ -48,12 +57,6 @@ Rectangle {
48 fontSizeMode: Text.Fit
57 fontSizeMode: Text.Fit
49 minimumPixelSize: 10; font.pixelSize: 200
58 minimumPixelSize: 10; font.pixelSize: 200
50 verticalAlignment: Text.AlignVCenter
59 verticalAlignment: Text.AlignVCenter
51− rotation: {
52− if (orientation == Qt.PortraitOrientation) return 0;
53− else if (orientation == Qt.LandscapeOrientation) return 90;
54− else if (orientation == Qt.InvertedPortraitOrientation) return 180;
55− else return 270;
56− }
57 }
60 }
58
61
59 MultiPointTouchArea {
62 MultiPointTouchArea {