diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-04-23 11:19:39 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-04-23 12:49:59 +0300 |
commit | 730bf7b256f0f06c39f92dad064869f5d1368c62 (patch) | |
tree | e836042801e0f2e0492de6ca576cd30c956c633d /basicsuite/About Boot to Qt/main.qml | |
parent | 2ceb4b09650242b97bf17b968c49b6e6cf12601a (diff) |
fixed up the demo suite
Change-Id: I42dfba551b26f66b8de41dad3df2a5e120c82fb8
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
Diffstat (limited to 'basicsuite/About Boot to Qt/main.qml')
-rw-r--r-- | basicsuite/About Boot to Qt/main.qml | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/basicsuite/About Boot to Qt/main.qml b/basicsuite/About Boot to Qt/main.qml new file mode 100644 index 0000000..6586811 --- /dev/null +++ b/basicsuite/About Boot to Qt/main.qml @@ -0,0 +1,135 @@ +import QtQuick 2.0 +import QtQuick.Particles 2.0 + +Item { + id: root + + width: 1280 + height: 800 + +// Rectangle { +// anchors.fill: parent +// color: "black" +// } + + Flickable { + id: flick + property real inertia: 0.4 + + property real cellWidth; + property real cellHeight; + + width: parent.width + height: parent.height + anchors.horizontalCenter: parent.horizontalCenter + + contentHeight: content.height + + flickableDirection: Flickable.VerticalFlick + + property real topOvershoot: Math.max(0, contentItem.y); + property real bottomOvershoot: Math.max(0, root.height - (contentItem.height + contentItem.y)); +// onTopOvershootChanged: print("Top Overshoot:", topOvershoot); +// onBottomOvershootChanged: print("Bottom Overshoot:", bottomOvershoot); + + Item { + id: shiftTrickery + + width: flick.width + height: content.height + + Column { + id: content; + + y: -flick.contentItem.y + offsetY; + width: flick.width * 2 / 3 + anchors.horizontalCenter: parent.horizontalCenter + + property real offsetY: 0; + property real inertia: flick.inertia; + property real t; + NumberAnimation on t { + id: animation; + from: 0; + to: 1; + duration: 1000; + loops: Animation.Infinite + running: Math.abs(content.y) > 0.001 || Math.abs(content.x) > 0.001 + } + + onTChanged: { + offsetY += (flick.contentItem.y - offsetY) * inertia + } + + + spacing: engine.smallFontSize() * 2 + + Item { width: 1; height: engine.smallFontSize() } + AboutBoot2Qt { } + QtFramework { } + QtForAndroid { } + Image { + id: codeLessImage + source: "codeless.png" + anchors.horizontalCenter: parent.horizontalCenter + } + Item { width: 1; height: engine.smallFontSize() } + } + + } + } + + ParticleSystem { + + anchors.fill: parent + + ImageParticle { + id: imageParticle + source: "particle.png" + color: "#80c342" + alpha: 0 + colorVariation: 0.3 + entryEffect: ImageParticle.None + } + + Emitter { + id: topEmitter + width: root.width + height: 1 + x: 0 + y: -1 + shape: EllipseShape { fill: true } + + emitRate: 300 + lifeSpan: 1000 + size: 20 + sizeVariation: 4 + endSize: 0 + + enabled: flick.topOvershoot > 0 + + velocity: PointDirection { xVariation: 10; yVariation: 50; y: Math.sqrt(flick.topOvershoot) * 10; } + acceleration: PointDirection { y: 50 } + } + + Emitter { + id: bottomEmitter + width: root.width + height: 1 + x: 0 + y: root.height + 1 + shape: EllipseShape { fill: true } + + emitRate: 300 + lifeSpan: 1000 + size: 20 + sizeVariation: 4 + endSize: 0 + + enabled: flick.bottomOvershoot > 0 + + velocity: PointDirection { xVariation: 10; yVariation: -50; y: Math.sqrt(flick.bottomOvershoot) * -10; } + acceleration: PointDirection { y: -50 } + } + } +} |