linphone-desktop/tests/ui/modules/Common/Popup/DropDownDynamicMenu.qml
2016-10-31 10:53:30 +01:00

26 lines
641 B
QML

import Utils 1.0
// ===================================================================
// Menu which supports `ListView`.
// ===================================================================
AbstractDropDownMenu {
property int entryHeight
property int maxMenuHeight
function _computeHeight () {
var list = _content[0]
Utils.assert(list != null, 'No list found.')
Utils.assert(
Utils.qmlTypeof(list, 'QQuickListView'),
'No list view parameter.'
)
var height = list.count * entryHeight
return (maxMenuHeight !== undefined && height > maxMenuHeight)
? maxMenuHeight
: height
}
}