Commit ac8b35b5 authored by Filip Matijević's avatar Filip Matijević

[rotation] simplify rotation usage by introducing rotationParent property

parent 79a7eb36
......@@ -41,6 +41,12 @@ Item {
property bool nativeIsPortrait: ((nativeRotation === 0) || (nativeRotation === 180))
}
property Item rotationParent
function rotateRotationParent(o) {
rotateObject(rotationParent, o)
}
function rotateObject(obj, o) {
var r = Screen.angleBetween(o, Screen.primaryOrientation)
......
......@@ -72,16 +72,17 @@ Page {
GlacierRotation {
id: glacierRotation
rotationParent: desktop.parent
}
orientation: Lipstick.compositor.screenOrientation
onOrientationChanged: {
glacierRotation.rotateObject(desktop.parent, orientation)
glacierRotation.rotateRotationParent(orientation)
}
onParentChanged: {
glacierRotation.rotateObject(desktop.parent, nativeOrientation)
glacierRotation.rotateRotationParent(nativeOrientation)
}
Component.onCompleted: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment