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 { ...@@ -13,6 +13,8 @@ Item {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
readonly property alias filter: searchField.text 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 entryHeight: menu.entryHeight
property alias maxMenuHeight: menu.maxMenuHeight property alias maxMenuHeight: menu.maxMenuHeight
...@@ -20,8 +22,6 @@ Item { ...@@ -20,8 +22,6 @@ Item {
default property alias _content: menu._content default property alias _content: menu._content
readonly property var view: _content[0]
property bool _isOpen: false property bool _isOpen: false
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
......
...@@ -16,17 +16,14 @@ Item { ...@@ -16,17 +16,14 @@ Item {
readonly property alias filter: searchField.text readonly property alias filter: searchField.text
readonly property alias isOpen: searchBox._isOpen 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 entryHeight: menu.entryHeight
property alias maxMenuHeight: menu.maxMenuHeight property alias maxMenuHeight: menu.maxMenuHeight
// This property must implement `setFilter` function.
property alias model: list.model
property alias placeholderText: searchField.placeholderText property alias placeholderText: searchField.placeholderText
default property alias _content: menu._content
property bool _isOpen: false property bool _isOpen: false
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
...@@ -55,6 +52,7 @@ Item { ...@@ -55,6 +52,7 @@ Item {
} }
function _filter (text) { function _filter (text) {
var model = searchBox.view.model
Utils.assert(model.setFilter != null, '`model.setFilter` must be defined.') Utils.assert(model.setFilter != null, '`model.setFilter` must be defined.')
model.setFilter(text) model.setFilter(text)
} }
...@@ -130,7 +128,7 @@ Item { ...@@ -130,7 +128,7 @@ Item {
DropDownDynamicMenu { DropDownDynamicMenu {
id: menu id: menu
implicitHeight: list.height implicitHeight: searchBox.view.height
width: searchField.width width: searchField.width
// If the menu is focused, the main window loses the active status. // If the menu is focused, the main window loses the active status.
...@@ -138,14 +136,19 @@ Item { ...@@ -138,14 +136,19 @@ Item {
Keys.forwardTo: searchField Keys.forwardTo: searchField
onClosed: searchBox.closeMenu() onClosed: searchBox.closeMenu()
}
}
ScrollableListView { Binding {
id: list target: searchBox.view
property: 'width'
value: searchField.width
}
headerPositioning: header ? ListView.OverlayHeader : ListView.InlineFooter Binding {
width: menu.width 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