2 * Copyright (C) 2015-2016 Canonical Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 property int fromAngle
27 readonly property real fromY: fromAngle === 0 || fromAngle === 90 ? 0 : orientedShell.height - orientedShell.width;
28 readonly property real toY: toAngle === 0 || toAngle === 90 ? 0 : orientedShell.height - orientedShell.width;
29 readonly property bool flipShellDimensions: toAngle == 90 || toAngle == 270
31 ScriptAction { script: {
32 info.transitioning = true;
34 shell.orientationAngle = root.toAngle;
36 shell.width = flipShellDimensions ? orientedShell.height : orientedShell.width;
37 shell.height = flipShellDimensions ? orientedShell.width : orientedShell.height;
38 shell.transformOriginX = orientedShell.width / 2;
39 shell.transformOriginY = orientedShell.width / 2;
40 shell.updateFocusedAppOrientation();
41 shellCover.visible = true;
43 shellSnapshot.transformOriginX = shell.transformOriginX;
44 shellSnapshot.transformOriginY = shell.transformOriginY;
45 shellSnapshot.transformRotationAngle = shell.transformRotationAngle;
46 shellSnapshot.visible = true;
50 target: shellCover; property: "opacity"; from: 1; to: 0;
51 duration: rotationDuration; easing.type: rotationEasing
54 target: shell; property: "transformRotationAngle";
55 from: root.fromAngle; to: root.toAngle
56 direction: RotationAnimation.Shortest
57 duration: rotationDuration; easing.type: rotationEasing
60 target: shell; property: "y"
61 from: root.fromY; to: root.toY
62 duration: rotationDuration; easing.type: rotationEasing
66 target: shellSnapshot; property: "opacity"; from: 1; to: 0;
67 duration: rotationDuration; easing.type: rotationEasing
70 target: shellSnapshot; property: "transformRotationAngle";
71 from: root.fromAngle; to: root.toAngle
72 direction: RotationAnimation.Shortest
73 duration: rotationDuration; easing.type: rotationEasing
76 target: shellSnapshot; property: "y"
77 from: root.fromY; to: root.toY
78 duration: rotationDuration; easing.type: rotationEasing
81 UpdateShellTransformations { shell: root.shell; rotationAngle: root.toAngle }
82 ScriptAction { script: {
83 shellSnapshot.visible = false;
84 shellSnapshot.discard();
85 shellCover.visible = false;
86 info.transitioning = false;