diff options
author | Lasse Räihä <lasse.raiha@digia.com> | 2013-05-31 14:37:54 +0300 |
---|---|---|
committer | Kimmo Ollila <kimmo.ollila@digia.com> | 2013-05-31 14:38:45 +0300 |
commit | ef71f7b07abaa967bfa5915afda54fe1c3ad0143 (patch) | |
tree | d75fc10815e8d6e173b8ac1ca2c86357c89c5343 /QtDemo | |
parent | 8b0e58ce6f8f43fb67980cb0ec9e82c5836a8503 (diff) |
Fixed fonts in devices. Fixed shader of slides.
Change-Id: I386ef2b3c20fd4b0bc23112655b91d1536ea0b2c
Reviewed-by: Kimmo Ollila <kimmo.ollila@digia.com>
Diffstat (limited to 'QtDemo')
-rw-r--r-- | QtDemo/qml/QtDemo/Slide.qml | 15 | ||||
-rw-r--r-- | QtDemo/qml/QtDemo/WorldCanvas.qml | 16 | ||||
-rw-r--r-- | QtDemo/qml/QtDemo/WorldPinchArea.qml | 28 | ||||
-rw-r--r-- | QtDemo/qml/QtDemo/engine.js | 33 | ||||
-rw-r--r-- | QtDemo/qml/QtDemo/main.qml | 8 |
5 files changed, 24 insertions, 76 deletions
diff --git a/QtDemo/qml/QtDemo/Slide.qml b/QtDemo/qml/QtDemo/Slide.qml index 1cd591f..7f2b274 100644 --- a/QtDemo/qml/QtDemo/Slide.qml +++ b/QtDemo/qml/QtDemo/Slide.qml @@ -19,8 +19,6 @@ Item { property int maskHorizontalOffset: 1 property string demoColor: "#883322" property string name: "" - property bool dirty: parent.angle !== 0 || rotation !==0 - property bool preventShader: false function targetWidth() { @@ -38,7 +36,7 @@ Item { width: demoContainer.width * 1.03 height: demoContainer.height * 1.03 color: "black" - z: !slide.dirty && (slide.loading || slide.loaded) ? 1:-1 + z: slide.loading || slide.loaded ? 1:-1 Rectangle{ id: demoContainer @@ -51,7 +49,7 @@ Item { Text { id: splashScreenText color: 'white' - font.pixelSize: parent.width *.1 + font.pixelSize: parent.width *.12 text: slide.name anchors.centerIn: parent smooth: true @@ -62,19 +60,22 @@ Item { ShaderEffectSource{ id: demo - anchors.centerIn: parent + //anchors.centerIn: parent + x: width/2 width: demoWidth height: demoHeight sourceItem: demoContainer - live: visible && (slide.loading || slide.loaded) - visible: (!slide.preventShader && slide.dirty) || !slide.loaded || updating + live: false + visible: hasSnapshot && (!slide.loaded || updating) hideSource: visible && !updating && !loading clip: true property bool updating: false + property bool hasSnapshot: false onScheduledUpdateCompleted: { updating = false + hasSnapshot = true releaseDemo(true) } } diff --git a/QtDemo/qml/QtDemo/WorldCanvas.qml b/QtDemo/qml/QtDemo/WorldCanvas.qml index e9a2c04..14abf1a 100644 --- a/QtDemo/qml/QtDemo/WorldCanvas.qml +++ b/QtDemo/qml/QtDemo/WorldCanvas.qml @@ -68,14 +68,6 @@ Item{ canvas.goHome() } - /*Behavior on angle { - RotationAnimation{ - duration: Style.APP_ANIMATION_DELAY - direction: RotationAnimation.Shortest - } - enabled: !worldPinchArea.pinching - }*/ - Behavior on xOffset { id: xOffsetBehaviour enabled: !worldMouseArea.panning @@ -92,13 +84,11 @@ Item{ NumberAnimation{ duration: Style.APP_ANIMATION_DELAY } - //enabled: !worldPinchArea.pinching } Behavior on rotationOriginY { NumberAnimation{ duration: Style.APP_ANIMATION_DELAY } - //enabled: !worldPinchArea.pinching } transform: [ @@ -111,11 +101,5 @@ Item{ yScale :canvas.scalingFactor } - /*Rotation{ - id: canvasRotation - origin.x: canvas.rotationOriginX - origin.y: canvas.rotationOriginY - angle: canvas.angle - }*/ ] } diff --git a/QtDemo/qml/QtDemo/WorldPinchArea.qml b/QtDemo/qml/QtDemo/WorldPinchArea.qml deleted file mode 100644 index 02bd3e5..0000000 --- a/QtDemo/qml/QtDemo/WorldPinchArea.qml +++ /dev/null @@ -1,28 +0,0 @@ -import QtQuick 2.0 - -PinchArea{ - id: worldPinchArea - anchors.fill: parent - pinch.target: pinchProxy - pinch.minimumScale: app.minScaleFactor - pinch.maximumScale: app.maxScaleFactor - pinch.maximumRotation: 360 - pinch.minimumRotation: -360 - enabled: !zoomAnimation.running && !navigationAnimation.running - - property bool pinching: false - - onPinchStarted: { - pinching = true - pinchProxy.rotation = canvas.angle - pinchProxy.scale = canvas.scalingFactor - - if (canvas.scalingFactor>1){ - var object = mapToItem(canvas, pinch.center.x, pinch.center.y) - - canvas.rotationOriginX = object.x - canvas.rotationOriginY = object.y - } - } - onPinchFinished: pinching = false; -} diff --git a/QtDemo/qml/QtDemo/engine.js b/QtDemo/qml/QtDemo/engine.js index 499c6db..b7a8f25 100644 --- a/QtDemo/qml/QtDemo/engine.js +++ b/QtDemo/qml/QtDemo/engine.js @@ -1,23 +1,23 @@ var positions = [ - {x:-800, y:-1500, gid: 0, preventShader: false, url: "demos/rssnews/rssnews.qml", device: 3, name: "Rss Reader"}, - {x:-1800, y:-1400, gid: 0, preventShader: false, url: "demos/gridrssnews/main.qml", device: 6, name: "Rss Reader"}, - {x:-1200, y:-1050, gid: 0, preventShader: false, url: "demos/tweetsearch/tweetsearch.qml", device: 2, name: "TweetSearch"}, + {x:-800, y:-1500, gid: 0, url: "demos/rssnews/rssnews.qml", device: 3, name: "Rss Reader"}, + {x:-1800, y:-1400, gid: 0, url: "demos/gridrssnews/main.qml", device: 6, name: "Rss Reader"}, + {x:-1200, y:-1050, gid: 0, url: "demos/tweetsearch/tweetsearch.qml", device: 2, name: "Tweet Search"}, - {x:1800, y:-1700, gid: 1, preventShader: true, url: "demos/heartmonitor/main.qml", device: 4, name: "Heart Monitor"}, - {x:1100, y:-1500, gid: 1, preventShader: false, url: "demos/canvasclock/canvasClock.qml", device: 4, name: "Canvas Clock"}, + {x:1800, y:-1700, gid: 1, url: "demos/heartmonitor/main.qml", device: 4, name: "Heart Monitor"}, + {x:1100, y:-1500, gid: 1, url: "demos/canvasclock/canvasClock.qml", device: 4, name: "Canvas Clock"}, - {x:1600, y:-500, gid: 2, preventShader: false, url: "demos/calqlatr/Calqlatr.qml", device: 0, name: "Calqlatr"}, - {x:700, y:-300, gid: 2, preventShader: false, url: "demos/photosurface/photosurface.qml", device: 5, name: "Photo Surface"}, - {x:-100, y:-50, gid: 2, preventShader: false, url: "demos/touchgallery/main.qml", device: 2, name: "Widget Gallery"}, + {x:1600, y:-500, gid: 2, url: "demos/calqlatr/Calqlatr.qml", device: 0, name: "Calqlatr"}, + {x:700, y:-300, gid: 2, url: "demos/photosurface/photosurface.qml", device: 5, name: "Photo Surface"}, + {x:-100, y:-50, gid: 2, url: "demos/touchgallery/main.qml", device: 2, name: "Widget Gallery"}, - {x:-1500, y:0, gid: 3, preventShader: false, url: "demos/maroon/Maroon.qml", device: 1, name: "Maroon in\n Trouble"}, - {x:-2200, y:100, gid: 3, preventShader: false, url: "demos/samegame/samegame.qml", device: 1, name: "SameGame"}, + {x:-1500, y:0, gid: 3, url: "demos/maroon/Maroon.qml", device: 1, name: "Maroon in\n Trouble"}, + {x:-2200, y:100, gid: 3, url: "demos/samegame/samegame.qml", device: 1, name: "SameGame"}, - {x:2200, y:1100, gid: 5, preventShader: true, url: "demos/particledemo/particledemo.qml", device: 6, name: "Particle Paint"}, - {x:1000, y:1280, gid: 5, preventShader: false, url: "demos/shaders/main.qml", device: 5, name: "Shaders"}, + {x:2200, y:1100, gid: 5, url: "demos/particledemo/particledemo.qml", device: 6, name: "Particle Paint"}, + {x:1000, y:1280, gid: 5, url: "demos/shaders/main.qml", device: 5, name: "Shaders"}, - {x:-800, y:1200, gid: 4, preventShader: false, url: "demos/video/main.qml", device: 7, name: "Qt Video"}, - {x:-1800, y:1400, gid: 4, preventShader: false, url: "demos/radio/radio.qml", device: 4, name: "Internet Radio"} + {x:-800, y:1200, gid: 4, url: "demos/video/main.qml", device: 7, name: "Qt Video"}, + {x:-1800, y:1400, gid: 4, url: "demos/radio/radio.qml", device: 4, name: "Internet Radio"} ] var groupPositions = [ @@ -47,11 +47,11 @@ var groups = [] function initSlides(){ positions.forEach(function(pos){ - createSlide(pos.x,pos.y, pos.gid, pos.preventShader, pos.url, pos.device, pos.name) + createSlide(pos.x,pos.y, pos.gid, pos.url, pos.device, pos.name) }) } -function createSlide(x,y,gid,preventShader,url,device,name){ +function createSlide(x,y,gid,url,device,name){ var component = Qt.createComponent("Slide.qml") if (component.status === Component.Ready){ var object=component.createObject(canvas) @@ -67,7 +67,6 @@ function createSlide(x,y,gid,preventShader,url,device,name){ object.maskHorizontalOffset = maskHorizontalOffsets[device] object.uid = objects.length object.gid = gid - object.preventShader = preventShader object.name = name object.x = x-object.width/2 object.y = y-object.height/2 diff --git a/QtDemo/qml/QtDemo/main.qml b/QtDemo/qml/QtDemo/main.qml index cb9467f..776ae1c 100644 --- a/QtDemo/qml/QtDemo/main.qml +++ b/QtDemo/qml/QtDemo/main.qml @@ -93,15 +93,7 @@ Rectangle{ Cloud { id: cloud5; sourceImage: "images/cloud2.png"} Cloud { id: cloud6; sourceImage: "images/cloud2.png"} - Item{ - id: pinchProxy - scale:.2 - onRotationChanged: canvas.angle=rotation - onScaleChanged: canvas.scalingFactor=scale - } - WorldMouseArea { id: worldMouseArea } - //WorldPinchArea { id: worldPinchArea } WorldCanvas { id:canvas } NavigationPanel{ id: navigationPanel } |