summaryrefslogtreecommitdiffstats
path: root/examples/declarative/toys/dynamicscene/qml/Button.qml
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-05-18 07:43:20 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-05-18 07:45:10 (GMT)
commitf4492bf01baae353ff63da18a9a602fb3a8058e4 (patch)
treedd26f922483ad4905cb2b0b38d2b9097dbf6178c /examples/declarative/toys/dynamicscene/qml/Button.qml
parentba9218a9786abddd461034b5aeb1d5a39f8072f9 (diff)
downloadQt-f4492bf01baae353ff63da18a9a602fb3a8058e4.zip
Qt-f4492bf01baae353ff63da18a9a602fb3a8058e4.tar.gz
Qt-f4492bf01baae353ff63da18a9a602fb3a8058e4.tar.bz2
Rename some examples: proxyviewer -> networkaccessmanagerfactory,
proxywidgets -> qwidgets, dynamic -> dynamicscene, velocity -> corkboards
Diffstat (limited to 'examples/declarative/toys/dynamicscene/qml/Button.qml')
-rw-r--r--examples/declarative/toys/dynamicscene/qml/Button.qml40
1 files changed, 40 insertions, 0 deletions
diff --git a/examples/declarative/toys/dynamicscene/qml/Button.qml b/examples/declarative/toys/dynamicscene/qml/Button.qml
new file mode 100644
index 0000000..963a850
--- /dev/null
+++ b/examples/declarative/toys/dynamicscene/qml/Button.qml
@@ -0,0 +1,40 @@
+import Qt 4.7
+
+Rectangle {
+ id: container
+
+ property variant text
+ signal clicked
+
+ height: text.height + 10; width: text.width + 20
+ border.width: 1
+ radius: 4
+ smooth: true
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: !mouseArea.pressed ? activePalette.light : activePalette.button
+ }
+ GradientStop {
+ position: 1.0
+ color: !mouseArea.pressed ? activePalette.button : activePalette.dark
+ }
+ }
+
+ SystemPalette { id: activePalette }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: container.clicked()
+ }
+
+ Text {
+ id: text
+ anchors.centerIn:parent
+ font.pointSize: 10
+ text: parent.text
+ color: activePalette.buttonText
+ }
+}