summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2016-11-14 11:59:16 +0100
committerPaul Olav Tvete <paul.tvete@qt.io>2016-11-15 13:00:27 +0000
commit7c3c32ecc62dfdb701daafc3f800767ff1eb9040 (patch)
tree713b349b749b0f0d0fc2bfce8f884291b1ee6471 /examples
parent24542e10ca4867b437ef4bdc46153888ce6d6d50 (diff)
Fade-out animation for menus
Since child items don't get transformation animations, enable an opacity transformation for them. Change-Id: I4ab77bc10d61602a0df72f5927cde4ebbcad27ce Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/wayland/pure-qml/qml/Chrome.qml3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/wayland/pure-qml/qml/Chrome.qml b/examples/wayland/pure-qml/qml/Chrome.qml
index d2ff5cc2a..dc3ad4731 100644
--- a/examples/wayland/pure-qml/qml/Chrome.qml
+++ b/examples/wayland/pure-qml/qml/Chrome.qml
@@ -44,6 +44,8 @@ import QtWayland.Compositor 1.0
ShellSurfaceItem {
id: rootChrome
+ property bool isChild: parent.shellSurface !== undefined
+
onSurfaceDestroyed: {
bufferLocked = true;
destroyAnimation.start();
@@ -67,6 +69,7 @@ ShellSurfaceItem {
ParallelAnimation {
NumberAnimation { target: scaleTransform; property: "yScale"; to: 2/height; duration: 150 }
NumberAnimation { target: scaleTransform; property: "xScale"; to: 0.4; duration: 150 }
+ NumberAnimation { target: rootChrome; property: "opacity"; to: rootChrome.isChild ? 0 : 1; duration: 150 }
}
NumberAnimation { target: scaleTransform; property: "xScale"; to: 0; duration: 150 }
ScriptAction { script: { rootChrome.destroy(); } }