summaryrefslogtreecommitdiffstats
path: root/demos/declarative/twitter/content/Button.qml
diff options
context:
space:
mode:
Diffstat (limited to 'demos/declarative/twitter/content/Button.qml')
-rw-r--r--demos/declarative/twitter/content/Button.qml13
1 files changed, 12 insertions, 1 deletions
diff --git a/demos/declarative/twitter/content/Button.qml b/demos/declarative/twitter/content/Button.qml
index 770330c..09d471c 100644
--- a/demos/declarative/twitter/content/Button.qml
+++ b/demos/declarative/twitter/content/Button.qml
@@ -6,6 +6,7 @@ Item {
signal clicked
property string text
+ property bool keyUsing: false
BorderImage {
id: buttonImage
@@ -24,15 +25,25 @@ Item {
onClicked: { container.clicked(); }
}
Text {
- color: "white"
+ id: btnText
+ color: if(container.keyUsing){"#DDDDDD";} else {"#FFFFFF";}
anchors.centerIn: buttonImage; font.bold: true
text: container.text; style: Text.Raised; styleColor: "black"
+ font.pixelSize: 12
}
states: [
State {
name: "Pressed"
when: mouseRegion.pressed == true
PropertyChanges { target: pressed; opacity: 1 }
+ },
+ State {
+ name: "Focused"
+ when: container.focus == true
+ PropertyChanges { target: btnText; color: "#FFFFFF" }
}
]
+ transitions: Transition {
+ ColorAnimation { target: btnText; }
+ }
}