mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-19 20:48:09 +00:00
fix(ui/modules/Common/Form/SearchBox): use correct properties
This commit is contained in:
parent
e601e3aa09
commit
6565d683bc
2 changed files with 19 additions and 16 deletions
|
|
@ -13,6 +13,8 @@ Item {
|
|||
// ---------------------------------------------------------------------------
|
||||
|
||||
readonly property alias filter: searchField.text
|
||||
readonly property alias isOpen: searchBox._isOpen
|
||||
readonly property var view: _content[0]
|
||||
|
||||
property alias entryHeight: menu.entryHeight
|
||||
property alias maxMenuHeight: menu.maxMenuHeight
|
||||
|
|
@ -20,8 +22,6 @@ Item {
|
|||
|
||||
default property alias _content: menu._content
|
||||
|
||||
readonly property var view: _content[0]
|
||||
|
||||
property bool _isOpen: false
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -16,17 +16,14 @@ Item {
|
|||
|
||||
readonly property alias filter: searchField.text
|
||||
readonly property alias isOpen: searchBox._isOpen
|
||||
readonly property var view: _content[0]
|
||||
|
||||
property alias delegate: list.delegate
|
||||
property alias header: list.header
|
||||
property alias entryHeight: menu.entryHeight
|
||||
property alias maxMenuHeight: menu.maxMenuHeight
|
||||
|
||||
// This property must implement `setFilter` function.
|
||||
property alias model: list.model
|
||||
|
||||
property alias placeholderText: searchField.placeholderText
|
||||
|
||||
default property alias _content: menu._content
|
||||
|
||||
property bool _isOpen: false
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
@ -55,6 +52,7 @@ Item {
|
|||
}
|
||||
|
||||
function _filter (text) {
|
||||
var model = searchBox.view.model
|
||||
Utils.assert(model.setFilter != null, '`model.setFilter` must be defined.')
|
||||
model.setFilter(text)
|
||||
}
|
||||
|
|
@ -130,7 +128,7 @@ Item {
|
|||
DropDownDynamicMenu {
|
||||
id: menu
|
||||
|
||||
implicitHeight: list.height
|
||||
implicitHeight: searchBox.view.height
|
||||
width: searchField.width
|
||||
|
||||
// If the menu is focused, the main window loses the active status.
|
||||
|
|
@ -138,15 +136,20 @@ Item {
|
|||
Keys.forwardTo: searchField
|
||||
|
||||
onClosed: searchBox.closeMenu()
|
||||
|
||||
ScrollableListView {
|
||||
id: list
|
||||
|
||||
headerPositioning: header ? ListView.OverlayHeader : ListView.InlineFooter
|
||||
width: menu.width
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binding {
|
||||
target: searchBox.view
|
||||
property: 'width'
|
||||
value: searchField.width
|
||||
}
|
||||
|
||||
Binding {
|
||||
target: searchBox.view
|
||||
property: 'headerPositioning'
|
||||
value: searchBox.view.header ? ListView.OverlayHeader : ListView.InlineFooter
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue