diff options
author | Fabian Bumberger <fbumberger@rim.com> | 2012-11-15 13:47:24 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-20 18:11:18 +0100 |
commit | dea27f3421e29a54add2fdab2424529f77535def (patch) | |
tree | f46f16480674181c9dd21a0816e78ec731647f6b /examples/demos/samegame/content/Button.qml | |
parent | 6c1d43060af15b2f80487d9982f5ef8423cfed8b (diff) |
Refactoring samegame
This patch cleans up the example and makes it more customizeable by adding a setting file. Also a bug has been fixed, where the "New game" button could not been clicked.
Change-Id: Ia397258721dfcf4900e3ed1e176a257eccfad354
Reviewed-by: Alan Alpert (RIM) <aalpert@rim.com>
Diffstat (limited to 'examples/demos/samegame/content/Button.qml')
-rw-r--r-- | examples/demos/samegame/content/Button.qml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/demos/samegame/content/Button.qml b/examples/demos/samegame/content/Button.qml index b17c831e41..aab21ec8c6 100644 --- a/examples/demos/samegame/content/Button.qml +++ b/examples/demos/samegame/content/Button.qml @@ -47,12 +47,15 @@ Item { property alias group: emitter.group signal clicked property bool rotatedButton: false - //Defaults, feel free to override + width: image.width - height: image.height + height: image.sourceSize.height Image { id: image - anchors.centerIn: parent + height: parent.height + width: height/sourceSize.height * sourceSize.width + + anchors.horizontalCenter: parent.horizontalCenter rotation: rotatedButton ? ((Math.random() * 3 + 2) * (Math.random() <= 0.5 ? -1 : 1)) : 0 MenuEmitter { id: emitter |