mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-06 20:23:08 +00:00
feat(ui/modules/Common/Form/SearchBox): remove usage of SmartConnect
This commit is contained in:
parent
5e69b750d0
commit
d9f1d86254
1 changed files with 16 additions and 21 deletions
|
|
@ -58,6 +58,15 @@ Item {
|
|||
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
|
||||
|
|
@ -84,30 +93,16 @@ Item {
|
|||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
SmartConnect {
|
||||
Component.onCompleted: {
|
||||
var window = searchBox.Window.window
|
||||
Connections {
|
||||
target: searchBox.Window.window
|
||||
|
||||
var handleCoords = function () {
|
||||
searchBox.hideMenu()
|
||||
onHeightChanged: _handleCoords()
|
||||
onWidthChanged: _handleCoords()
|
||||
|
||||
var point = searchBox.mapToItem(null, 0, searchBox.height)
|
||||
onXChanged: _handleCoords()
|
||||
onYChanged: _handleCoords()
|
||||
|
||||
desktopPopup.popupX = window.x + point.x
|
||||
desktopPopup.popupY = window.y + point.y
|
||||
}
|
||||
|
||||
// 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)
|
||||
|
||||
handleCoords()
|
||||
}
|
||||
onVisibilityChanged: _handleCoords()
|
||||
}
|
||||
|
||||
// Wrap the search box menu in a window.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue