From fae073096e027bbf079efac7fdd8e3f34ba0a4ab Mon Sep 17 00:00:00 2001 From: Ian Walters Date: Tue, 26 May 2009 10:06:40 +1000 Subject: 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. --- demos/declarative/contacts/contacts.qml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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 -- cgit v0.12