From a9e4271c3589cb3788d5868e90ddfc3286d76b03 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Fri, 23 Jun 2017 15:59:04 +0200 Subject: [PATCH] Transition on when toggle search box --- retroshare-qml-app/src/Contacts.qml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index 93784c27c..b4357a90e 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -162,7 +162,7 @@ Item Rectangle { id: searchBox - visible: contactsView.searching +// visible: contactsView.searching height: searchText.height + 10 width: parent.width * 0.9 @@ -177,9 +177,10 @@ Item { id: searchText anchors.verticalCenter: parent.verticalCenter - placeholderText : "Search contacts..." - width: parent.width - 5 +// placeholderText : "Search contacts..." + width: parent.width anchors.leftMargin: 5 + height: 0 background: Rectangle { @@ -193,6 +194,27 @@ Item contactsSortWorker.sendMessage( {'action': 'searchContact', 'sexp': text}) } + + states: + [ + State + { + when: contactsView.searching; + PropertyChanges { target: searchText; height: implicitHeight } + PropertyChanges { target: searchText; placeholderText : "Search contacts..." } + PropertyChanges { target: searchBox; height: searchText.height + 10 } + }, + State + { + when: !contactsView.searching; + PropertyChanges { target: searchText; height: 0 } + PropertyChanges { target: searchBox; height: 0 } + } + ] + transitions: Transition + { + NumberAnimation { property: "height"; duration: 500; easing.type: Easing.InOutQuad} + } } Text