diff --git a/retroshare-qml-app/src/Contacts.qml b/retroshare-qml-app/src/Contacts.qml index 5984b0c50..93784c27c 100644 --- a/retroshare-qml-app/src/Contacts.qml +++ b/retroshare-qml-app/src/Contacts.qml @@ -35,6 +35,7 @@ Item Component.onCompleted: { toolBar.state = "CONTACTSVIEW" + toolBar.searchBtnCb = toggleSearchBox refreshAll() } onFocusChanged: focus && refreshAll() @@ -46,6 +47,11 @@ Item onMessage: contactsListModel.json = JSON.stringify(messageObject) } + function toggleSearchBox (){ + if (searching) searching = false + else searching = true + } + function refreshAll() { refreshOwn() diff --git a/retroshare-qml-app/src/components/SideBar.qml b/retroshare-qml-app/src/components/SideBar.qml index d4ab3bdd8..6393afbcc 100644 --- a/retroshare-qml-app/src/components/SideBar.qml +++ b/retroshare-qml-app/src/components/SideBar.qml @@ -183,8 +183,7 @@ Drawer }, "Search Contacts": function() { - stackView.push("qrc:/Contacts.qml", - {'searching': true} ) + stackView.push("qrc:/Contacts.qml" ) }, "Paste Link": function() { diff --git a/retroshare-qml-app/src/main-app.qml b/retroshare-qml-app/src/main-app.qml index ebe1515b5..ca9a1c2df 100644 --- a/retroshare-qml-app/src/main-app.qml +++ b/retroshare-qml-app/src/main-app.qml @@ -63,6 +63,8 @@ ApplicationWindow property alias loaderSource: imageLoader.sourceComponent property string defaultLabel: "RetroShare" + property var searchBtnCb + states: [ State @@ -120,6 +122,7 @@ ApplicationWindow BtnIcon { property bool searchIconVisibility: false + property var onClickCB: function (){} id: searchIcon height: (coreReady)? parent.height - 10 : 0 @@ -130,8 +133,7 @@ ApplicationWindow visible: searchIconVisibility && coreReady onClicked: { - stackView.push("qrc:/Contacts.qml", - {'searching': true} ) + toolBar.searchBtnCb() } } MouseArea