summaryrefslogtreecommitdiffstats
path: root/WebkitSlide.qml
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@digia.com>2012-12-18 14:07:57 +0100
committerGunnar Sletta <gunnar.sletta@digia.com>2012-12-18 14:07:57 +0100
commitb0b2fc0913c5de4eca81329858d47f470d87282b (patch)
treea7143ed385a9a7fab16f4432a765e9641e7ade02 /WebkitSlide.qml
parent74300c194f93881835c072368650c311818e16b7 (diff)
Tweaks to the demo
Diffstat (limited to 'WebkitSlide.qml')
-rw-r--r--WebkitSlide.qml53
1 files changed, 49 insertions, 4 deletions
diff --git a/WebkitSlide.qml b/WebkitSlide.qml
index 6806529..7d9c44b 100644
--- a/WebkitSlide.qml
+++ b/WebkitSlide.qml
@@ -1,4 +1,5 @@
import QtQuick 2.0
+import QtQuick.Particles 2.0
import QtWebKit 3.0
import Qt.labs.presentation 1.0
@@ -10,7 +11,7 @@ Slide {
WebView {
id: browser
anchors.fill: parent
- url: textInput.text
+ url: editor.text
// This works around rendering bugs in webkit. CSS animations
// and webGL content gets a bad offset, but this hack
@@ -25,20 +26,64 @@ Slide {
border.color: "black"
opacity: 0.5
color: "black"
- anchors.fill: textInput
- anchors.margins: -textInput.height * 0.2;
+ anchors.fill: editor
+ anchors.margins: -editor.height * 0.2;
radius: -anchors.margins
antialiasing: true
}
TextInput {
- id: textInput
+ id: editor
anchors.top: browser.bottom;
anchors.horizontalCenter: browser.horizontalCenter
font.pixelSize: slide.baseFontSize;
text: "http://qt.digia.com"
onAccepted: browser.reload();
color: "white"
+
+ onCursorPositionChanged: {
+
+ var rect = positionToRectangle(cursorPosition);
+ print(rect);
+ emitter.x = rect.x;
+ emitter.y = rect.y;
+ emitter.width = rect.width;
+ emitter.height = rect.height;
+ emitter.burst(10);
+ }
+
+ ParticleSystem {
+ id: sys1
+ running: slide.visible
+ }
+
+ ImageParticle {
+ system: sys1
+ source: "images/particle.png"
+ color: "white"
+ colorVariation: 0.2
+ alpha: 0
+ }
+
+ Emitter {
+ id: emitter
+ system: sys1
+
+ enabled: false
+
+ lifeSpan: 2000
+
+ velocity: PointDirection { xVariation: 30; yVariation: 30; }
+ acceleration: PointDirection {xVariation: 30; yVariation: 30; y: 100 }
+
+ endSize: 0
+
+ size: 8
+ sizeVariation: 2
+ }
}
+
+
+
}