[ui] Controls: add SearchBar component + better keyboard focus handling

* use it in MetadataListView and GraphEditor 'add Node' menu
* GraphEditor: forward MenuItem key events to searchBar to be able to continue editing the filter even if it lost active focus
This commit is contained in:
Yann Lanthony 2019-01-07 16:48:17 +01:00
parent b5c985b3fb
commit b46a2dbba1
4 changed files with 62 additions and 28 deletions

View file

@ -121,17 +121,9 @@ FloatingPane {
ColumnLayout {
anchors.fill: parent
// Search toolbar
RowLayout {
Label {
text: MaterialIcons.search
font.family: MaterialIcons.fontFamily
}
TextField {
id: filter
Layout.fillWidth: true
z: 2
}
SearchBar {
id: searchBar
Layout.fillWidth: true
}
// Metadata ListView
@ -148,7 +140,7 @@ FloatingPane {
model: metadataModel
sortRole: "raw"
filterRole: "raw"
filterValue: filter.text
filterValue: searchBar.text
delegate: RowLayout {
width: parent.width
Label {