diff options
-rw-r--r-- | examples/declarative/dynamic/qml/PerspectiveItem.qml | 11 | ||||
-rw-r--r-- | examples/declarative/dynamic/qml/itemCreation.js | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/examples/declarative/dynamic/qml/PerspectiveItem.qml b/examples/declarative/dynamic/qml/PerspectiveItem.qml index 55a70d5..728c3a5 100644 --- a/examples/declarative/dynamic/qml/PerspectiveItem.qml +++ b/examples/declarative/dynamic/qml/PerspectiveItem.qml @@ -3,10 +3,13 @@ import Qt 4.6 Image { id: tree property bool created: false - opacity: y+height > window.height/2 ? 1 : 0.25 - onCreatedChanged: if (created && y+height<=window.height/2) { tree.destroy() } - scale: y+height > window.height/2 ? (y+height-250)*0.01 : 1 + property double scaleFactor: Math.max((y+height-250)*0.01, 0.3) + property double scaledBottom: y + (height+height*scaleFactor)/2 + property bool onLand: scaledBottom > window.height/2 + opacity: onLand ? 1 : 0.25 + onCreatedChanged: if (created && !onLand) { tree.destroy() } else { z = scaledBottom } + scale: scaleFactor transformOrigin: "Center" source: image; smooth: true - z: y + onYChanged: z = scaledBottom } diff --git a/examples/declarative/dynamic/qml/itemCreation.js b/examples/declarative/dynamic/qml/itemCreation.js index b3e8ba5..ccc03aa 100644 --- a/examples/declarative/dynamic/qml/itemCreation.js +++ b/examples/declarative/dynamic/qml/itemCreation.js @@ -32,7 +32,7 @@ function loadComponent() { createItem(); itemComponent = createComponent(itemButton.file); - print(itemButton.file) + //print(itemButton.file) if(itemComponent.isLoading){ component.statusChanged.connect(finishCreation); }else{//Depending on the content, it can be ready or error immediately |