From 64892e1c4e324eac88df4b80067f4cf62c5cfe21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Sat, 9 Mar 2013 01:53:24 +0100 Subject: [PATCH] Use hideSource, Luke And, dear Luke, don't implement the same in twenty eight lines that are just one property away. RTFM, Luke. --- .../testcontainment/contents/ui/main.qml | 28 ++----------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/src/shell/containments/testcontainment/contents/ui/main.qml b/src/shell/containments/testcontainment/contents/ui/main.qml index 4d02d858d..1fa3d0473 100644 --- a/src/shell/containments/testcontainment/contents/ui/main.qml +++ b/src/shell/containments/testcontainment/contents/ui/main.qml @@ -126,10 +126,10 @@ Item { id: wobbleShader anchors.fill: frame property variant source: ShaderEffectSource { - id: theSource + hideSource: true sourceItem: frame } - opacity: 0 + property int fadeDuration: 250 property real amplitude: busyIndicator.visible ? 0.04 * 0.2 : 0 property real frequency: 20 @@ -149,30 +149,6 @@ Item { " gl_FragColor = texture2D(source, qt_TexCoord0 + amplitude * vec2(p.y, -p.x)) * qt_Opacity;" + "}" } - - // compose the item on-screen, we want to render - // either the shader item or the source item, - // so swap their opacity as the wobbling fades in - // and after it fades out - Connections { - target: busyIndicator - onVisibleChanged: { - if (busyIndicator.visible) { - wobbleShader.opacity = 1; - frame.opacity = 0; - } else { - hideTimer.start(); - } - } - } - Timer { - id: hideTimer - interval: wobbleShader.fadeDuration - onTriggered: { - wobbleShader.opacity = 0; - frame.opacity = 1; - } - } //! [fragment] } }