diff options
Diffstat (limited to 'demos/declarative')
-rw-r--r-- | demos/declarative/calculator/Core/calculator.js | 2 | ||||
-rw-r--r-- | demos/declarative/calculator/calculator.qml | 29 | ||||
-rw-r--r-- | demos/declarative/flickr/mobile/TitleBar.qml | 1 | ||||
-rw-r--r-- | demos/declarative/minehunt/minehunt.pro | 2 | ||||
-rw-r--r-- | demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml | 4 | ||||
-rw-r--r-- | demos/declarative/rssnews/content/NewsDelegate.qml | 3 | ||||
-rw-r--r-- | demos/declarative/samegame/SamegameCore/BoomBlock.qml | 11 | ||||
-rw-r--r-- | demos/declarative/samegame/SamegameCore/Dialog.qml | 2 | ||||
-rwxr-xr-x | demos/declarative/samegame/SamegameCore/samegame.js | 7 | ||||
-rw-r--r-- | demos/declarative/samegame/samegame.qml | 2 | ||||
-rw-r--r-- | demos/declarative/snake/content/snake.js | 6 | ||||
-rw-r--r-- | demos/declarative/twitter/TwitterCore/AuthView.qml | 3 | ||||
-rw-r--r-- | demos/declarative/twitter/TwitterCore/HomeTitleBar.qml | 3 | ||||
-rw-r--r-- | demos/declarative/twitter/TwitterCore/TitleBar.qml | 1 |
14 files changed, 52 insertions, 24 deletions
diff --git a/demos/declarative/calculator/Core/calculator.js b/demos/declarative/calculator/Core/calculator.js index 51b3dd3..c80c42f 100644 --- a/demos/declarative/calculator/Core/calculator.js +++ b/demos/declarative/calculator/Core/calculator.js @@ -84,7 +84,7 @@ function doOperation(op) { } if (op == rotateLeft) - main.state = 'rotated' + main.state = "orientation " + Orientation.Landscape if (op == rotateRight) main.state = '' } diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml index 3d36211..63b6c55 100644 --- a/demos/declarative/calculator/calculator.qml +++ b/demos/declarative/calculator/calculator.qml @@ -58,10 +58,11 @@ Rectangle { property string plusminus : "\u00b1" function doOp(operation) { CalcEngine.doOperation(operation) } - + Item { id: main - state: (runtime.orientation == Orientation.Portrait) ? '' : 'rotated' + state: "orientation " + runtime.orientation + width: parent.width; height: parent.height; anchors.centerIn: parent Column { @@ -130,16 +131,28 @@ Rectangle { } } - states: State { - name: 'rotated' - PropertyChanges { target: main; rotation: -90; width: window.height; height: window.width } - PropertyChanges { target: rotateButton; operation: rotateRight } - } + states: [ + State { + name: "orientation " + Orientation.Landscape + PropertyChanges { target: main; rotation: -90; width: window.height; height: window.width } + PropertyChanges { target: rotateButton; operation: rotateRight } + }, + State { + name: "orientation " + Orientation.PortraitInverted + PropertyChanges { target: main; rotation: -180; } + PropertyChanges { target: rotateButton; operation: rotateLeft } + }, + State { + name: "orientation " + Orientation.LandscapeInverted + PropertyChanges { target: main; rotation: -270; width: window.height; height: window.width } + PropertyChanges { target: rotateButton; operation: rotateRight } + } + ] transitions: Transition { SequentialAnimation { PropertyAction { target: rotateButton; property: "operation" } - NumberAnimation { properties: "rotation"; duration: 300; easing.type: Easing.InOutQuint } + RotationAnimation { direction: RotationAnimation.Shortest; duration: 300; easing.type: Easing.InOutQuint } NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: Easing.InOutQuint } } } diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml index c7e1a53..335c315 100644 --- a/demos/declarative/flickr/mobile/TitleBar.qml +++ b/demos/declarative/flickr/mobile/TitleBar.qml @@ -109,6 +109,7 @@ Item { Item { id: returnKey Keys.onReturnPressed: container.accept() + Keys.onEnterPressed: container.accept() Keys.onEscapePressed: titleBar.state = "" } } diff --git a/demos/declarative/minehunt/minehunt.pro b/demos/declarative/minehunt/minehunt.pro index aac91f6..f85afeb 100644 --- a/demos/declarative/minehunt/minehunt.pro +++ b/demos/declarative/minehunt/minehunt.pro @@ -27,7 +27,7 @@ symbian:{ TARGET.EPOCALLOWDLLDATA = 1 include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) TARGET.CAPABILITY = NetworkServices ReadUserData - importFiles.sources = qmlminehuntplugin.dll \ + importFiles.sources = MinehuntCore/qmlminehuntplugin.dll \ MinehuntCore/Explosion.qml \ MinehuntCore/pics \ MinehuntCore/qmldir diff --git a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml index 6109535..be7dfa4 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/EditableButton.qml @@ -64,6 +64,10 @@ Item { container.labelChanged(textInput.text) container.focus = true } + Keys.onEnterPressed: { + container.labelChanged(textInput.text) + container.focus = true + } Keys.onEscapePressed: { textInput.text = container.label container.focus = true diff --git a/demos/declarative/rssnews/content/NewsDelegate.qml b/demos/declarative/rssnews/content/NewsDelegate.qml index 040dadc..cfe9b00 100644 --- a/demos/declarative/rssnews/content/NewsDelegate.qml +++ b/demos/declarative/rssnews/content/NewsDelegate.qml @@ -43,10 +43,11 @@ import Qt 4.7 Item { id: delegate - height: childrenRect.height + 20 + height: column.height + 40 width: delegate.ListView.view.width Column { + id: column x: 20; y: 20 width: parent.width - 40 diff --git a/demos/declarative/samegame/SamegameCore/BoomBlock.qml b/demos/declarative/samegame/SamegameCore/BoomBlock.qml index 3f43579..43050af 100644 --- a/demos/declarative/samegame/SamegameCore/BoomBlock.qml +++ b/demos/declarative/samegame/SamegameCore/BoomBlock.qml @@ -47,11 +47,14 @@ Item { property bool dying: false property bool spawned: false property int type: 0 - property int targetX: 0 - property int targetY: 0 - SpringFollow on x { enabled: spawned; to: targetX; spring: 2; damping: 0.2 } - SpringFollow on y { to: targetY; spring: 2; damping: 0.2 } + Behavior on x { + enabled: spawned; + SpringAnimation{ spring: 2; damping: 0.2 } + } + Behavior on y { + SpringAnimation{ spring: 2; damping: 0.2 } + } Image { id: img diff --git a/demos/declarative/samegame/SamegameCore/Dialog.qml b/demos/declarative/samegame/SamegameCore/Dialog.qml index c71a4b3..7e64bd6 100644 --- a/demos/declarative/samegame/SamegameCore/Dialog.qml +++ b/demos/declarative/samegame/SamegameCore/Dialog.qml @@ -49,6 +49,8 @@ Rectangle { signal closed signal opened function forceClose() { + if(page.opacity == 0) + return; //already closed page.closed(); page.opacity = 0; } diff --git a/demos/declarative/samegame/SamegameCore/samegame.js b/demos/declarative/samegame/SamegameCore/samegame.js index 5c008a2..6e1b24d 100755 --- a/demos/declarative/samegame/SamegameCore/samegame.js +++ b/demos/declarative/samegame/SamegameCore/samegame.js @@ -110,7 +110,7 @@ function shuffleDown() }else{ if(fallDist > 0){ var obj = board[index(column,row)]; - obj.targetY += fallDist * gameCanvas.blockSize; + obj.y += fallDist * gameCanvas.blockSize; board[index(column,row+fallDist)] = obj; board[index(column,row)] = null; } @@ -128,7 +128,7 @@ function shuffleDown() obj = board[index(column,row)]; if(obj == null) continue; - obj.targetX -= fallDist * gameCanvas.blockSize; + obj.x -= fallDist * gameCanvas.blockSize; board[index(column-fallDist,row)] = obj; board[index(column,row)] = null; } @@ -184,8 +184,7 @@ function createBlock(column,row){ } dynamicObject.type = Math.floor(Math.random() * 3); dynamicObject.x = column*gameCanvas.blockSize; - dynamicObject.targetX = column*gameCanvas.blockSize; - dynamicObject.targetY = row*gameCanvas.blockSize; + dynamicObject.y = row*gameCanvas.blockSize; dynamicObject.width = gameCanvas.blockSize; dynamicObject.height = gameCanvas.blockSize; dynamicObject.spawned = true; diff --git a/demos/declarative/samegame/samegame.qml b/demos/declarative/samegame/samegame.qml index 10bf79f..9504fb6 100644 --- a/demos/declarative/samegame/samegame.qml +++ b/demos/declarative/samegame/samegame.qml @@ -88,7 +88,7 @@ Rectangle { Behavior on width { NumberAnimation {} - enabled: initialWidth != 0 + enabled: nameInputDialog.initialWidth != 0 } onOpened: nameInputText.focus = true; diff --git a/demos/declarative/snake/content/snake.js b/demos/declarative/snake/content/snake.js index 4d05e33..0f0dbf7 100644 --- a/demos/declarative/snake/content/snake.js +++ b/demos/declarative/snake/content/snake.js @@ -150,7 +150,7 @@ function move() { snake.push(newLink); } else { var lastLink = snake[snake.length-1]; - board[lastLink.row * numColumns + lastLink.column] = Undefined; + board[lastLink.row * numColumns + lastLink.column] = undefined; } if (waitForCookie > 0) { @@ -186,7 +186,7 @@ function move() { function isFree(row, column) { - return board[row * numColumns + column] == Undefined; + return board[row * numColumns + column] == undefined; } function isHead(row, column) @@ -214,7 +214,7 @@ function moveSkull() --linksToDie; var link = snake.pop(); link.dying = true; - board[link.row * numColumns + link.column] = Undefined; + board[link.row * numColumns + link.column] = undefined; if (score > 0) --score; if (snake.length == 0) { diff --git a/demos/declarative/twitter/TwitterCore/AuthView.qml b/demos/declarative/twitter/TwitterCore/AuthView.qml index ef10258..0d05deb 100644 --- a/demos/declarative/twitter/TwitterCore/AuthView.qml +++ b/demos/declarative/twitter/TwitterCore/AuthView.qml @@ -93,6 +93,7 @@ Item { color: "#151515"; selectionColor: "green" KeyNavigation.tab: login KeyNavigation.backtab: nameIn + onAccepted: login.doLogin(); } } } @@ -114,6 +115,7 @@ Item { KeyNavigation.tab: guest KeyNavigation.backtab: passIn Keys.onReturnPressed: login.doLogin(); + Keys.onEnterPressed: login.doLogin(); Keys.onSelectPressed: login.doLogin(); Keys.onSpacePressed: login.doLogin(); onClicked: login.doLogin(); @@ -134,6 +136,7 @@ Item { KeyNavigation.tab: nameIn KeyNavigation.backtab: login Keys.onReturnPressed: guest.doGuest(); + Keys.onEnterPressed: guest.doGuest(); Keys.onSelectPressed: guest.doGuest(); Keys.onSpacePressed: guest.doGuest(); onClicked: guest.doGuest(); diff --git a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml index 52164ed..56f31b1 100644 --- a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml +++ b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml @@ -128,7 +128,7 @@ Item { cursorVisible: true; font.bold: true width: parent.width - 12 height: parent.height - 8 - font.pointSize: 10 + font.pixelSize: 12 wrapMode: TextEdit.Wrap color: "#151515"; selectionColor: "green" } @@ -136,6 +136,7 @@ Item { Item { id: returnKey Keys.onReturnPressed: container.accept() + Keys.onEnterPressed: container.accept() Keys.onEscapePressed: titleBar.state = "" } } diff --git a/demos/declarative/twitter/TwitterCore/TitleBar.qml b/demos/declarative/twitter/TwitterCore/TitleBar.qml index 6cd0a50..558bc18 100644 --- a/demos/declarative/twitter/TwitterCore/TitleBar.qml +++ b/demos/declarative/twitter/TwitterCore/TitleBar.qml @@ -98,6 +98,7 @@ Item { Item { id: returnKey Keys.onReturnPressed: container.accept() + Keys.onEnterPressed: container.accept() Keys.onEscapePressed: titleBar.state = "" } } |