summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Walters <ian.walters@nokia.com>2009-05-26 00:06:40 (GMT)
committerIan Walters <ian.walters@nokia.com>2009-05-26 00:06:40 (GMT)
commitfae073096e027bbf079efac7fdd8e3f34ba0a4ab (patch)
tree968f79a451797fc1df07ca0e0f61b71161380bad
parent9a98d7ee708b631686e8aad61206ebb74311e0a6 (diff)
downloadQt-fae073096e027bbf079efac7fdd8e3f34ba0a4ab.zip
Qt-fae073096e027bbf079efac7fdd8e3f34ba0a4ab.tar.gz
Qt-fae073096e027bbf079efac7fdd8e3f34ba0a4ab.tar.bz2
fade text accross white to black
Prior to this change, when the highlight moved the text would blink from white to black. This was a little disconcerting. Add in a smooth blend for the color change.
-rw-r--r--demos/declarative/contacts/contacts.qml21
1 files changed, 20 insertions, 1 deletions
diff --git a/demos/declarative/contacts/contacts.qml b/demos/declarative/contacts/contacts.qml
index 42ea2b1..9b6d321 100644
--- a/demos/declarative/contacts/contacts.qml
+++ b/demos/declarative/contacts/contacts.qml
@@ -34,7 +34,7 @@ Rect {
y: 12
width: parent.width-30
text: model.label
- color: wrapper.ListView.isCurrentItem ? "black" : "white"
+ color: "white"
font.bold: true
children: [
MouseRegion {
@@ -46,6 +46,25 @@ Rect {
}
}
]
+ states: [
+ State {
+ name: "currentItem"
+ when: wrapper.ListView.isCurrentItem
+ SetProperty {
+ target: label
+ property: "color"
+ value: "black"
+ }
+ }
+ ]
+ transitions: [
+ Transition {
+ ColorAnimation {
+ duration: 250
+ property: "color"
+ }
+ }
+ ]
}
Item {
id: Details