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:
12
qml/components/Search.qml
Normal file
12
qml/components/Search.qml
Normal 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: ;
|
||||
}
|
@ -1,2 +1,3 @@
|
||||
FileDir 1.0 FileDir.qml
|
||||
Link 1.0 Link.qml
|
||||
Link 1.0 Link.qml
|
||||
Search 1.0 Search.qml
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user