mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-20 04:58:09 +00:00
Move options button in waiting room because of readability. Add a confirmation before calling a group from conversation. Make an option to set RLS URI. Avoid to close smart search bar when changing focus. It will now close only on empty text, esc keybutton or by manually closing it (cross icon when text has been entered) Hide "adding contact" if search box is empty. Add a switch in accounts selection to easily register them. Update SDK to 5.2.81 # Conflicts: # linphone-app/src/components/search/SearchSipAddressesModel.cpp # linphone-sdk
87 lines
2 KiB
QML
87 lines
2 KiB
QML
import QtQuick 2.7
|
|
|
|
import Common 1.0
|
|
import Utils 1.0
|
|
|
|
// =============================================================================
|
|
|
|
Item {
|
|
id: menu
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
property alias relativeTo: popup.relativeTo
|
|
property alias relativeX: popup.relativeX
|
|
property alias relativeY: popup.relativeY
|
|
|
|
// Can be computed, but for performance usage, it must be given in attribute.
|
|
property int entryHeight
|
|
property int maxMenuHeight
|
|
|
|
default property alias _content: menuContent.data
|
|
property alias closePolicy : popup.closePolicy
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
signal closed
|
|
signal opened
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
function open () {
|
|
popup.open()
|
|
}
|
|
|
|
function close () {
|
|
popup.close()
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
function _computeHeight () {
|
|
Utils.assert(_content != null && _content.length > 0, '`_content` cannot be null and must exists.')
|
|
|
|
var list = _content[0]
|
|
Utils.assert(list != null, 'No list found.')
|
|
|
|
var height = list.count * entryHeight
|
|
|
|
if (list.headerPositioning === ListView.OverlayHeader) {
|
|
// Workaround to force header layout.
|
|
list.headerItem.z = Constants.zMax
|
|
|
|
height += list.headerItem.height
|
|
}
|
|
|
|
return (maxMenuHeight !== undefined && maxMenuHeight != 0 && height > maxMenuHeight)
|
|
? maxMenuHeight
|
|
: height
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
visible: false
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
Popup {
|
|
id: popup
|
|
|
|
onOpened: menu.opened()
|
|
onClosed: menu.closed()
|
|
height: menu._computeHeight()
|
|
width: menu._content[0].width
|
|
|
|
Item {
|
|
id: menuContent
|
|
anchors.fill: parent
|
|
|
|
}
|
|
}
|
|
|
|
Binding {
|
|
property: 'height'
|
|
target: menu._content[0]
|
|
value: menuContent.height
|
|
}
|
|
}
|