summaryrefslogtreecommitdiffstats
path: root/examples/declarative/toys/tic-tac-toe/content/Button.qml
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-05-31 05:23:40 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-05-31 05:23:40 (GMT)
commitf587dfeaa9d369235d347af3d14339054ee59908 (patch)
tree3ac92f6a08d871099d8808e8d5fc59f50863bacb /examples/declarative/toys/tic-tac-toe/content/Button.qml
parentfeb9949a11abbf244e0bfcdc128981596758de40 (diff)
parent9da305aedfaa5da5a3059c99ac5a5389dab42b10 (diff)
downloadQt-f587dfeaa9d369235d347af3d14339054ee59908.zip
Qt-f587dfeaa9d369235d347af3d14339054ee59908.tar.gz
Qt-f587dfeaa9d369235d347af3d14339054ee59908.tar.bz2
Merge remote branch 'staging/4.7' into HEAD
Diffstat (limited to 'examples/declarative/toys/tic-tac-toe/content/Button.qml')
-rw-r--r--examples/declarative/toys/tic-tac-toe/content/Button.qml34
1 files changed, 18 insertions, 16 deletions
diff --git a/examples/declarative/toys/tic-tac-toe/content/Button.qml b/examples/declarative/toys/tic-tac-toe/content/Button.qml
index 9b2dc8e..d0f387f 100644
--- a/examples/declarative/toys/tic-tac-toe/content/Button.qml
+++ b/examples/declarative/toys/tic-tac-toe/content/Button.qml
@@ -43,35 +43,37 @@ import Qt 4.7
Rectangle {
id: container
- property string text: "Button"
- property bool down: false
- property string mainCol: "lightgray"
- property string darkCol: "darkgray"
- property string lightCol: "white"
+ property string text
+ property bool pressed: false
+
+ signal clicked
width: buttonLabel.width + 20; height: buttonLabel.height + 6
- border { width: 1; color: Qt.darker(mainCol) }
- radius: 8;
- color: mainCol
+ border { width: 1; color: Qt.darker(container.color) }
+ radius: 8
+ color: "lightgray"
smooth: true
gradient: Gradient {
GradientStop {
- id: topGrad; position: 0.0
- color: if (container.down) { darkCol } else { lightCol }
+ position: 0.0
+ color: container.pressed ? "darkgray" : "white"
+ }
+ GradientStop {
+ position: 1.0
+ color: container.color
}
- GradientStop { position: 1.0; color: mainCol }
}
- signal clicked
-
- MouseArea { id: mr; anchors.fill: parent; onClicked: container.clicked() }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: container.clicked()
+ }
Text {
id: buttonLabel
-
anchors.centerIn: container
- text: container.text;
+ text: container.text
font.pixelSize: 14
}
}