diff options
author | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2010-05-12 15:01:55 (GMT) |
---|---|---|
committer | Morten Engvoldsen <morten.engvoldsen@nokia.com> | 2010-05-12 15:01:55 (GMT) |
commit | d41ccae68683dd0d35c20affec7e5c55ce6bca37 (patch) | |
tree | 270fe804f2b130243da4e714cc1a135690bc466d /examples/declarative/tutorials/samegame/samegame4/samegame.qml | |
parent | 5987412720498aa22202a1bcca3cb988a9cf5606 (diff) | |
parent | 41cbfc5c8e6644ab21e92860db95b2e8da9aba6a (diff) | |
download | Qt-d41ccae68683dd0d35c20affec7e5c55ce6bca37.zip Qt-d41ccae68683dd0d35c20affec7e5c55ce6bca37.tar.gz Qt-d41ccae68683dd0d35c20affec7e5c55ce6bca37.tar.bz2 |
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'examples/declarative/tutorials/samegame/samegame4/samegame.qml')
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame4/samegame.qml | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/examples/declarative/tutorials/samegame/samegame4/samegame.qml b/examples/declarative/tutorials/samegame/samegame4/samegame.qml index 404af0a..feb61fd 100644 --- a/examples/declarative/tutorials/samegame/samegame4/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame4/samegame.qml @@ -25,7 +25,7 @@ Rectangle { property int score: 0 property int blockSize: 40 - z: 20; anchors.centerIn: parent + anchors.centerIn: parent width: parent.width - (parent.width % blockSize); height: parent.height - (parent.height % blockSize); @@ -35,53 +35,41 @@ Rectangle { } } - Dialog { id: dialog; anchors.centerIn: parent; z: 21 } + Dialog { + id: dialog + anchors.centerIn: parent + z: 100 + } //![0] Dialog { id: nameInputDialog - anchors.centerIn: parent - z: 22 + z: 100 - Text { - id: dialogText - opacity: 0 - text: " You won! Please enter your name:" - } - - TextInput { - id: nameInput - width: 72 - anchors { verticalCenter: parent.verticalCenter; left: dialogText.right } - focus: true - - onAccepted: { - if (nameInputDialog.opacity == 1 && nameInput.text != "") - SameGame.saveHighScore(nameInput.text); - nameInputDialog.forceClose(); - } + onClosed: { + if (nameInputDialog.inputText != "") + SameGame.saveHighScore(nameInputDialog.inputText); } } //![0] Rectangle { id: toolBar - width: parent.width; height: 32 + width: parent.width; height: 30 color: activePalette.window anchors.bottom: screen.bottom Button { - anchors { left: parent.left; leftMargin: 3; verticalCenter: parent.verticalCenter } + anchors { left: parent.left; verticalCenter: parent.verticalCenter } text: "New Game" onClicked: SameGame.startNewGame() } Text { id: score - anchors { right: parent.right; rightMargin: 3; verticalCenter: parent.verticalCenter } + anchors { right: parent.right; verticalCenter: parent.verticalCenter } text: "Score: " + gameCanvas.score - font.bold: true } } } |