summaryrefslogtreecommitdiffstats
path: root/examples/declarative/dynamic/qml/Button.qml
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@nokia.com>2010-05-12 07:42:52 (GMT)
committerMorten Johan Sørvig <morten.sorvig@nokia.com>2010-05-12 07:42:52 (GMT)
commit731a2f16578ead0f75f2752e757b138376b2f872 (patch)
tree2b6f9746771992f97cbdb5cf5af8f35ac6928b26 /examples/declarative/dynamic/qml/Button.qml
parent37475bcc4aef3f08c5917f22c7f0f427e4214b91 (diff)
parentb4c589868f278aa9a58ab9afa727dbf0a9442e22 (diff)
downloadQt-731a2f16578ead0f75f2752e757b138376b2f872.zip
Qt-731a2f16578ead0f75f2752e757b138376b2f872.tar.gz
Qt-731a2f16578ead0f75f2752e757b138376b2f872.tar.bz2
Merge remote branch 'mainline/4.7' into 4.7
Conflicts: src/declarative/qml/qdeclarativeengine.cpp tools/qdoc3/htmlgenerator.cpp
Diffstat (limited to 'examples/declarative/dynamic/qml/Button.qml')
-rw-r--r--examples/declarative/dynamic/qml/Button.qml36
1 files changed, 26 insertions, 10 deletions
diff --git a/examples/declarative/dynamic/qml/Button.qml b/examples/declarative/dynamic/qml/Button.qml
index 53588bb..963a850 100644
--- a/examples/declarative/dynamic/qml/Button.qml
+++ b/examples/declarative/dynamic/qml/Button.qml
@@ -6,19 +6,35 @@ Rectangle {
property variant text
signal clicked
- SystemPalette { id: activePalette }
- height: text.height + 10
- width: text.width + 20
+ height: text.height + 10; width: text.width + 20
border.width: 1
- radius: 4; smooth: true
+ radius: 4
+ smooth: true
+
gradient: Gradient {
- GradientStop { position: 0.0;
- color: if(!mr.pressed){activePalette.light;}else{activePalette.button;}
+ GradientStop {
+ position: 0.0
+ color: !mouseArea.pressed ? activePalette.light : activePalette.button
}
- GradientStop { position: 1.0;
- color: if(!mr.pressed){activePalette.button;}else{activePalette.dark;}
+ GradientStop {
+ position: 1.0
+ color: !mouseArea.pressed ? activePalette.button : activePalette.dark
}
}
- MouseArea { id:mr; anchors.fill: parent; onClicked: container.clicked() }
- Text { id: text; anchors.centerIn:parent; font.pointSize: 10; text: parent.text; color: activePalette.buttonText }
+
+ 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
+ }
}