mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-02 11:26:31 -05:00
Toggle search contacts field using search icon on toolbar
This commit is contained in:
parent
d8eafaf9ea
commit
353b34fcab
@ -35,6 +35,7 @@ Item
|
|||||||
Component.onCompleted:
|
Component.onCompleted:
|
||||||
{
|
{
|
||||||
toolBar.state = "CONTACTSVIEW"
|
toolBar.state = "CONTACTSVIEW"
|
||||||
|
toolBar.searchBtnCb = toggleSearchBox
|
||||||
refreshAll()
|
refreshAll()
|
||||||
}
|
}
|
||||||
onFocusChanged: focus && refreshAll()
|
onFocusChanged: focus && refreshAll()
|
||||||
@ -46,6 +47,11 @@ Item
|
|||||||
onMessage: contactsListModel.json = JSON.stringify(messageObject)
|
onMessage: contactsListModel.json = JSON.stringify(messageObject)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleSearchBox (){
|
||||||
|
if (searching) searching = false
|
||||||
|
else searching = true
|
||||||
|
}
|
||||||
|
|
||||||
function refreshAll()
|
function refreshAll()
|
||||||
{
|
{
|
||||||
refreshOwn()
|
refreshOwn()
|
||||||
|
@ -183,8 +183,7 @@ Drawer
|
|||||||
},
|
},
|
||||||
"Search Contacts": function()
|
"Search Contacts": function()
|
||||||
{
|
{
|
||||||
stackView.push("qrc:/Contacts.qml",
|
stackView.push("qrc:/Contacts.qml" )
|
||||||
{'searching': true} )
|
|
||||||
},
|
},
|
||||||
"Paste Link": function()
|
"Paste Link": function()
|
||||||
{
|
{
|
||||||
|
@ -63,6 +63,8 @@ ApplicationWindow
|
|||||||
property alias loaderSource: imageLoader.sourceComponent
|
property alias loaderSource: imageLoader.sourceComponent
|
||||||
property string defaultLabel: "RetroShare"
|
property string defaultLabel: "RetroShare"
|
||||||
|
|
||||||
|
property var searchBtnCb
|
||||||
|
|
||||||
states:
|
states:
|
||||||
[
|
[
|
||||||
State
|
State
|
||||||
@ -120,6 +122,7 @@ ApplicationWindow
|
|||||||
BtnIcon
|
BtnIcon
|
||||||
{
|
{
|
||||||
property bool searchIconVisibility: false
|
property bool searchIconVisibility: false
|
||||||
|
property var onClickCB: function (){}
|
||||||
|
|
||||||
id: searchIcon
|
id: searchIcon
|
||||||
height: (coreReady)? parent.height - 10 : 0
|
height: (coreReady)? parent.height - 10 : 0
|
||||||
@ -130,8 +133,7 @@ ApplicationWindow
|
|||||||
visible: searchIconVisibility && coreReady
|
visible: searchIconVisibility && coreReady
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
stackView.push("qrc:/Contacts.qml",
|
toolBar.searchBtnCb()
|
||||||
{'searching': true} )
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MouseArea
|
MouseArea
|
||||||
|
Loading…
Reference in New Issue
Block a user