summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-08-26 03:46:01 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-08-26 03:46:01 (GMT)
commitb4116c58cacc46732ff24db1ea8bf082fcb4b489 (patch)
treebd3962cb9bc7825341dc20f604bb9e85a2ad255f /demos
parent407e131dfc2f85518e42be6ca7a2b43946d0413c (diff)
downloadQt-b4116c58cacc46732ff24db1ea8bf082fcb4b489.zip
Qt-b4116c58cacc46732ff24db1ea8bf082fcb4b489.tar.gz
Qt-b4116c58cacc46732ff24db1ea8bf082fcb4b489.tar.bz2
Maintain high score name dialog length, as well as name.
Task-number: QTBUG-13129
Diffstat (limited to 'demos')
-rwxr-xr-xdemos/declarative/samegame/SamegameCore/samegame.js3
-rw-r--r--demos/declarative/samegame/samegame.qml1
2 files changed, 3 insertions, 1 deletions
diff --git a/demos/declarative/samegame/SamegameCore/samegame.js b/demos/declarative/samegame/SamegameCore/samegame.js
index aa1b359..9266767 100755
--- a/demos/declarative/samegame/SamegameCore/samegame.js
+++ b/demos/declarative/samegame/SamegameCore/samegame.js
@@ -151,7 +151,8 @@ function victoryCheck()
gameDuration = new Date() - gameDuration;
nameInputDialog.show("You won! Please enter your name: ");
nameInputDialog.initialWidth = nameInputDialog.text.width + 20;
- nameInputDialog.width = nameInputDialog.initialWidth;
+ if(nameInputDialog.name == "")
+ nameInputDialog.width = nameInputDialog.initialWidth;
nameInputDialog.text.opacity = 0;//Just a spacer
}
}
diff --git a/demos/declarative/samegame/samegame.qml b/demos/declarative/samegame/samegame.qml
index 9504fb6..3e9c505 100644
--- a/demos/declarative/samegame/samegame.qml
+++ b/demos/declarative/samegame/samegame.qml
@@ -82,6 +82,7 @@ Rectangle {
id: nameInputDialog
property int initialWidth: 0
+ property alias name: nameInputText.text
anchors.centerIn: parent
z: 22;