summaryrefslogtreecommitdiffstats
path: root/examples/qml-compositor
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2012-02-13 20:39:22 +0100
committerJørgen Lind <jorgen.lind@nokia.com>2012-02-14 09:55:02 +0100
commit2ed43741ab4106c6a1e9eb3a5cb9a6c5ff34f450 (patch)
tree305297d6f665d3f43ef131f5f5577262fa325303 /examples/qml-compositor
parentb61d1417dc81761276b3bac44775141b3551ef4e (diff)
Added convenience properties in WaylandSurface for window orientation.
The new windowRotation property is especially useful for the compositor to know how much the surface needs to be rotated in order to be displayed correctly. Change-Id: I81ee17880ceafd465c39b4439dee978f2cb80924 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'examples/qml-compositor')
-rw-r--r--examples/qml-compositor/main.cpp5
-rw-r--r--examples/qml-compositor/qml/QmlCompositor/WindowContainer.qml5
2 files changed, 9 insertions, 1 deletions
diff --git a/examples/qml-compositor/main.cpp b/examples/qml-compositor/main.cpp
index 530fee8bf..8a016f396 100644
--- a/examples/qml-compositor/main.cpp
+++ b/examples/qml-compositor/main.cpp
@@ -101,6 +101,11 @@ private slots:
}
protected:
+ void resizeEvent(QResizeEvent *)
+ {
+ WaylandCompositor::setOutputGeometry(QRect(0, 0, width(), height()));
+ }
+
void surfaceCreated(WaylandSurface *surface) {
WaylandSurfaceItem *item = new WaylandSurfaceItem(surface, rootObject());
item->setTouchEventsEnabled(true);
diff --git a/examples/qml-compositor/qml/QmlCompositor/WindowContainer.qml b/examples/qml-compositor/qml/QmlCompositor/WindowContainer.qml
index ed1dad54f..ae70e3b87 100644
--- a/examples/qml-compositor/qml/QmlCompositor/WindowContainer.qml
+++ b/examples/qml-compositor/qml/QmlCompositor/WindowContainer.qml
@@ -86,7 +86,10 @@ Item {
}
}
- transform: Scale { id: scaleTransform; origin.x: container.width / 2; origin.y: container.height / 2; xScale: 1; yScale: 1 }
+ transform: [
+ Rotation { origin.x: container.width / 2; origin.y: container.height / 2; angle: (child && child.surface ? child.surface.windowRotation : 0) },
+ Scale { id: scaleTransform; origin.x: container.width / 2; origin.y: container.height / 2; xScale: 1; yScale: 1 }
+ ]
SequentialAnimation {
id: destroyAnimation