diff --git a/linphone-desktop/ui/modules/Common/Form/+linux/SearchBox.qml b/linphone-desktop/ui/modules/Common/Form/+linux/SearchBox.qml index 2066328b1..84aeedda0 100644 --- a/linphone-desktop/ui/modules/Common/Form/+linux/SearchBox.qml +++ b/linphone-desktop/ui/modules/Common/Form/+linux/SearchBox.qml @@ -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 // --------------------------------------------------------------------------- diff --git a/linphone-desktop/ui/modules/Common/Form/SearchBox.qml b/linphone-desktop/ui/modules/Common/Form/SearchBox.qml index 4948eff78..3fa7702cf 100644 --- a/linphone-desktop/ui/modules/Common/Form/SearchBox.qml +++ b/linphone-desktop/ui/modules/Common/Form/SearchBox.qml @@ -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 + } } // ---------------------------------------------------------------------------