1
0
mirror of https://github.com/QRouland/UTPass.git synced 2025-06-29 16:52:29 +00:00

Add search bar

This commit is contained in:
2019-03-16 10:08:41 +01:00
parent 16f8f70692
commit 7458507c9b
5 changed files with 59 additions and 20 deletions

12
qml/components/Search.qml Normal file
View File

@ -0,0 +1,12 @@
import QtQuick 2.4
Item {
TextField {
id: searchBar
placeholderText: i18n.tr("Search")
height: units.gu(4)
visible: false
anchors.verticalCenter: parent.verticalCenter
}
Component.onCompleted: ;
}

View File

@ -1,2 +1,3 @@
FileDir 1.0 FileDir.qml
Link 1.0 Link.qml
Link 1.0 Link.qml
Search 1.0 Search.qml

View File

@ -7,6 +7,26 @@ PageHeader {
height: units.gu(6)
title: i18n.tr("UTPass")
contents: Item {
height : parent.height
width: parent.width
Label {
id : labelTitle
text: mainHeader.title
anchors.verticalCenter: parent.verticalCenter
visible: true
}
TextField {
id: searchBar
anchors.right : parent.right
anchors.left : parent.left
placeholderText: i18n.tr("Search")
height: units.gu(4)
visible: false
anchors.verticalCenter: parent.verticalCenter
}
}
trailingActionBar.height: units.gu(4)
trailingActionBar.numberOfSlots: 2
trailingActionBar.actions: [
@ -14,13 +34,8 @@ PageHeader {
iconName: "search"
text: i18n.tr("Search")
onTriggered: {
mainHeader.contents = TextField {
id: searchBar
placeholderText: i18n.tr("Search")
height: units.gu(4)
visible: false
anchors.verticalCenter: parent.verticalCenter
}
searchBar.visible = searchBar.visible ? false : true;
labelTitle.visible = labelTitle.visible ? false : true;
}
},
Action {

View File

@ -2,10 +2,21 @@ import QtQuick 2.4
import Ubuntu.Components 1.3
PageHeader {
id: stackHeader
width: parent.width
height: units.gu(6)
title: i18n.tr("UTPass")
contents: Item {
height : parent.height
width: parent.width
Label {
id : labelTitle
text: stackHeader.title
anchors.verticalCenter: parent.verticalCenter
}
}
leadingActionBar.height: units.gu(4)
leadingActionBar.actions: [
Action {