Commit 6565d683 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(ui/modules/Common/Form/SearchBox): use correct properties

parent e601e3aa
......@@ -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,14 +136,19 @@ Item {
Keys.forwardTo: searchField
onClosed: searchBox.closeMenu()
}
}
ScrollableListView {
id: list
Binding {
target: searchBox.view
property: 'width'
value: searchField.width
}
headerPositioning: header ? ListView.OverlayHeader : ListView.InlineFooter
width: menu.width
}
}
Binding {
target: searchBox.view
property: 'headerPositioning'
value: searchBox.view.header ? ListView.OverlayHeader : ListView.InlineFooter
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment