diff options
author | Ian Walters <ian.walters@nokia.com> | 2009-05-08 04:23:10 (GMT) |
---|---|---|
committer | Ian Walters <ian.walters@nokia.com> | 2009-05-08 04:23:10 (GMT) |
commit | 11e54d7349b14a3fa4cd7faf1bae584cee6503f6 (patch) | |
tree | 076d24f94cb2697659cd889775bddd0b66e1dd59 /demos/declarative | |
parent | 22ccc2041ab058b6b84c23dcf6852ee052579e49 (diff) | |
download | Qt-11e54d7349b14a3fa4cd7faf1bae584cee6503f6.zip Qt-11e54d7349b14a3fa4cd7faf1bae584cee6503f6.tar.gz Qt-11e54d7349b14a3fa4cd7faf1bae584cee6503f6.tar.bz2 |
Current item highlight
Unfortunatley the color doesn't animate. A 'Behavior' doesn't
work (still snaps) and using states and transitions causes
a crash within the ListView code.
Diffstat (limited to 'demos/declarative')
-rw-r--r-- | demos/declarative/contacts/contacts.qml | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/demos/declarative/contacts/contacts.qml b/demos/declarative/contacts/contacts.qml index b38e02e..42ea2b1 100644 --- a/demos/declarative/contacts/contacts.qml +++ b/demos/declarative/contacts/contacts.qml @@ -34,14 +34,14 @@ Rect { y: 12 width: parent.width-30 text: model.label - color: "white" + color: wrapper.ListView.isCurrentItem ? "black" : "white" font.bold: true children: [ MouseRegion { anchors.fill: parent onClicked: { Details.qml = 'Contact.qml'; - wrapper.state='opened'; + wrapper.state ='opened'; contacts.mode = 'edit'; } } @@ -190,10 +190,26 @@ Rect { anchors.left: parent.left anchors.right: parent.right anchors.top: cancelEditButton.bottom - anchors.bottom: searchBarWrapper.bottom + anchors.bottom: searchBarWrapper.top + anchors.topMargin: 5 clip: true model: contactList delegate: contactDelegate + highlight: [ + Rect { + id: contactHighlight + pen.width: 0 + color: 'white' + opacity: contacts.mode == 'list' ? 1 : 0 + opacity: Behaviour { + NumericAnimation { + property: "opacity" + duration: 250 + } + } + } + ] + autoHighlight: true focus: false } FocusRealm { |