mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-23 22:58:15 +00:00
feat(SearchBox): create _filter function
This commit is contained in:
parent
a1f33b4238
commit
691a82106e
1 changed files with 13 additions and 12 deletions
|
|
@ -44,6 +44,18 @@ Item {
|
|||
_isOpen = true
|
||||
}
|
||||
|
||||
function _filter (text) {
|
||||
console.assert(
|
||||
model.setFilterFixedString != null,
|
||||
'`model.setFilterFixedString` must be defined.'
|
||||
)
|
||||
|
||||
model.setFilterFixedString(text)
|
||||
if (model.invalidate) {
|
||||
model.invalidate()
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
implicitHeight: searchField.height
|
||||
|
|
@ -63,18 +75,7 @@ Item {
|
|||
Keys.onEscapePressed: searchBox.hideMenu()
|
||||
|
||||
onActiveFocusChanged: activeFocus && searchBox.showMenu()
|
||||
onTextChanged: {
|
||||
console.assert(
|
||||
model.setFilterFixedString != null,
|
||||
'`model.setFilterFixedString` must be defined.'
|
||||
)
|
||||
|
||||
model.setFilterFixedString(text)
|
||||
|
||||
if (model.invalidate) {
|
||||
model.invalidate()
|
||||
}
|
||||
}
|
||||
onTextChanged: _filter()
|
||||
}
|
||||
|
||||
// Wrap the search box menu in a window.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue