summaryrefslogtreecommitdiffstats
path: root/demos/declarative/samegame/content/Button.qml
diff options
context:
space:
mode:
Diffstat (limited to 'demos/declarative/samegame/content/Button.qml')
-rw-r--r--demos/declarative/samegame/content/Button.qml18
1 files changed, 18 insertions, 0 deletions
diff --git a/demos/declarative/samegame/content/Button.qml b/demos/declarative/samegame/content/Button.qml
new file mode 100644
index 0000000..c7a49f1
--- /dev/null
+++ b/demos/declarative/samegame/content/Button.qml
@@ -0,0 +1,18 @@
+import Qt 4.6
+
+Rect {
+ id: page; color: activePalette.button; width: txtItem.width+20; height: txtItem.height+4
+ border.width: 1; border.color: activePalette.mid; radius: 10;
+ signal clicked
+ property string text: "Button"
+ gradient: Gradient {
+ GradientStop { id:topGrad; position: 0.0;
+ color: if(mr.pressed){activePalette.dark;}else{activePalette.light;}}
+ GradientStop { position: 1.0; color: activePalette.button }
+ }
+ MouseRegion { id:mr; anchors.fill: parent; onClicked: page.clicked() }
+ Text {
+ id: txtItem; text: page.text; anchors.centerIn: page; color: activePalette.buttonText
+ font.size: 14;
+ }
+}