Change search icon on toolbar to invoke search field on contacts

This commit is contained in:
Angela Mazzurco 2017-06-22 17:50:42 +02:00
parent 2360c3c27a
commit b9d21f004c
2 changed files with 18 additions and 11 deletions

View File

@ -160,22 +160,12 @@ Item
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
color: "white" color: "white"
Image
{
id: searchIcon
height: searchText.height / 2
width: searchText.height / 2
anchors.verticalCenter: parent.verticalCenter
source: "qrc:/icons/searvh.svg"
}
TextField TextField
{ {
id: searchText id: searchText
anchors.left: searchIcon.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
placeholderText : "Search contacts..." placeholderText : "Search contacts..."
width: parent.width - searchIcon.width - 5 width: parent.width - 5
anchors.leftMargin: 5 anchors.leftMargin: 5
background: Rectangle background: Rectangle

View File

@ -108,8 +108,25 @@ ApplicationWindow
anchors.left: imageLoader.right anchors.left: imageLoader.right
anchors.leftMargin: 20 anchors.leftMargin: 20
} }
BtnIcon
{
id: searchIcon
height: parent.height - 10
width: parent.height - 10
anchors.verticalCenter: parent.verticalCenter
imgUrl: "qrc:/icons/search.svg"
anchors.right: menu.left
onClicked:
{
stackView.push("qrc:/Contacts.qml",
{'searching': true} )
}
}
MouseArea MouseArea
{ {
id: menu
height: parent.height height: parent.height
width: parent.height width: parent.height
anchors.right: parent.right anchors.right: parent.right