summaryrefslogtreecommitdiffstats
path: root/basicsuite/About Qt on Android/main.qml
diff options
context:
space:
mode:
Diffstat (limited to 'basicsuite/About Qt on Android/main.qml')
-rw-r--r--basicsuite/About Qt on Android/main.qml69
1 files changed, 65 insertions, 4 deletions
diff --git a/basicsuite/About Qt on Android/main.qml b/basicsuite/About Qt on Android/main.qml
index c952500..6586811 100644
--- a/basicsuite/About Qt on Android/main.qml
+++ b/basicsuite/About Qt on Android/main.qml
@@ -1,4 +1,5 @@
import QtQuick 2.0
+import QtQuick.Particles 2.0
Item {
id: root
@@ -13,12 +14,12 @@ Item {
Flickable {
id: flick
- property real inertia: 0.2
+ property real inertia: 0.4
property real cellWidth;
property real cellHeight;
- width: parent.width * 2 / 3
+ width: parent.width
height: parent.height
anchors.horizontalCenter: parent.horizontalCenter
@@ -26,17 +27,23 @@ Item {
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: content.width
+ width: flick.width
height: content.height
Column {
id: content;
y: -flick.contentItem.y + offsetY;
- width: flick.width
+ width: flick.width * 2 / 3
+ anchors.horizontalCenter: parent.horizontalCenter
property real offsetY: 0;
property real inertia: flick.inertia;
@@ -71,4 +78,58 @@ Item {
}
}
+
+ 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 }
+ }
+ }
}