Commit d9f1d862 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/modules/Common/Form/SearchBox): remove usage of `SmartConnect`

parent 5e69b750
...@@ -58,6 +58,15 @@ Item { ...@@ -58,6 +58,15 @@ Item {
model.setFilter(text) model.setFilter(text)
} }
function _handleCoords () {
searchBox.hideMenu()
var point = searchBox.mapToItem(null, 0, searchBox.height)
desktopPopup.popupX = window.x + point.x
desktopPopup.popupY = window.y + point.y
}
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
implicitHeight: searchField.height implicitHeight: searchField.height
...@@ -84,30 +93,16 @@ Item { ...@@ -84,30 +93,16 @@ Item {
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
SmartConnect { Connections {
Component.onCompleted: { target: searchBox.Window.window
var window = searchBox.Window.window
var handleCoords = function () {
searchBox.hideMenu()
var point = searchBox.mapToItem(null, 0, searchBox.height) onHeightChanged: _handleCoords()
onWidthChanged: _handleCoords()
desktopPopup.popupX = window.x + point.x onXChanged: _handleCoords()
desktopPopup.popupY = window.y + point.y onYChanged: _handleCoords()
}
// The menu is always below the search field.
this.connect(window, 'heightChanged', handleCoords)
this.connect(window, 'widthChanged', handleCoords)
this.connect(window, 'xChanged', handleCoords)
this.connect(window, 'yChanged', handleCoords)
this.connect(window, 'visibilityChanged', handleCoords) onVisibilityChanged: _handleCoords()
handleCoords()
}
} }
// Wrap the search box menu in a window. // Wrap the search box menu in a window.
......
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