aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/demos/stocqt/content/Button.qml
diff options
context:
space:
mode:
authorAlan Alpert <aalpert@rim.com>2012-11-30 12:23:53 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-12 23:07:34 +0100
commit47d97fe72bff0bfd4e2a32ecb7850502cf0a82d5 (patch)
tree4a1583113c4e31caf5c2594a41c631ed9b43decd /examples/quick/demos/stocqt/content/Button.qml
parentce97fe0fc482f2fda72583544e3436508f73417e (diff)
Fix StocQt buttons
They're now on screen and using better componentization for the styling. Task-number: QTBUG-28291 Change-Id: If21712e523c706ee05d257e209ed71dd61acf2dc Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'examples/quick/demos/stocqt/content/Button.qml')
-rw-r--r--examples/quick/demos/stocqt/content/Button.qml23
1 files changed, 13 insertions, 10 deletions
diff --git a/examples/quick/demos/stocqt/content/Button.qml b/examples/quick/demos/stocqt/content/Button.qml
index 0e99c52c51..2cdd187629 100644
--- a/examples/quick/demos/stocqt/content/Button.qml
+++ b/examples/quick/demos/stocqt/content/Button.qml
@@ -42,18 +42,21 @@ import QtQuick 2.0
Rectangle {
id:button
- property bool buttonEnabled:true
+ signal clicked
+ property alias text: txt.text
+ property bool buttonEnabled:false
radius:5
- width:25
- height:25
- color:buttonEnabled ? "steelblue" : "gray"
+ width: Math.max(64,txt.width+16);
+ height: 32
+ color: buttonEnabled ? "steelblue" : "gray"
MouseArea {
anchors.fill:parent
- onClicked: {
- if (buttonEnabled)
- buttonEnabled = false;
- else
- buttonEnabled = true;
- }
+ onClicked: button.clicked();
+ }
+ Text {
+ anchors.centerIn: parent
+ font.pixelSize: 18
+ color:"#ecc089"
+ id: txt
}
}