Add search bar

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

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: utpass.qrouland\n" "Project-Id-Version: utpass.qrouland\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-03-15 17:28+0000\n" "POT-Creation-Date: 2019-03-16 09:07+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,8 +17,9 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: ../qml/pages/Settings.qml:8 ../qml/pages/headers/MainHeader.qml:28 #: ../qml/components/Search.qml:6 ../qml/pages/headers/MainHeader.qml:23
msgid "Settings" #: ../qml/pages/headers/MainHeader.qml:36
msgid "Search"
msgstr "" msgstr ""
#: ../qml/pages/PasswordList.qml:17 #: ../qml/pages/PasswordList.qml:17
@ -29,20 +30,19 @@ msgstr ""
msgid "No password found in the current folder" msgid "No password found in the current folder"
msgstr "" msgstr ""
#: ../qml/pages/Info.qml:9 ../qml/pages/headers/MainHeader.qml:35 #: ../qml/pages/Settings.qml:8 ../qml/pages/headers/MainHeader.qml:44
msgid "Info" msgid "Settings"
msgstr "" msgstr ""
#: ../qml/pages/Info.qml:43 ../qml/pages/headers/MainHeader.qml:8 #: ../qml/pages/headers/MainHeader.qml:8 ../qml/pages/headers/StackHeader.qml:8
#: ../qml/pages/headers/StackHeader.qml:7 UTPass.desktop.in.h:1 #: ../qml/pages/Info.qml:43 UTPass.desktop.in.h:1
msgid "UTPass" msgid "UTPass"
msgstr "" msgstr ""
#: ../qml/pages/headers/MainHeader.qml:51 ../qml/pages/Info.qml:9
msgid "Info"
msgstr ""
#: ../qml/pages/Info.qml:53 #: ../qml/pages/Info.qml:53
msgid "Suggest improvement(s) or report a bug(s)" msgid "Suggest improvement(s) or report a bug(s)"
msgstr "" msgstr ""
#: ../qml/pages/headers/MainHeader.qml:15
#: ../qml/pages/headers/MainHeader.qml:19
msgid "Search"
msgstr ""

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

View File

@ -2,10 +2,21 @@ import QtQuick 2.4
import Ubuntu.Components 1.3 import Ubuntu.Components 1.3
PageHeader { PageHeader {
id: stackHeader
width: parent.width width: parent.width
height: units.gu(6) height: units.gu(6)
title: i18n.tr("UTPass") 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.height: units.gu(4)
leadingActionBar.actions: [ leadingActionBar.actions: [
Action { Action {