mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-24 15:18:07 +00:00
44 lines
906 B
QML
44 lines
906 B
QML
import QtQuick 2.7
|
|
|
|
import Common 1.0
|
|
import Common.Styles 1.0
|
|
|
|
// ===================================================================
|
|
// Low component to display a list/menu in a popup.
|
|
// ===================================================================
|
|
|
|
Rectangle {
|
|
default property alias content: content.data
|
|
property int entryHeight
|
|
property int maxMenuHeight
|
|
|
|
function show () {
|
|
visible = true
|
|
}
|
|
|
|
function hide () {
|
|
visible = false
|
|
}
|
|
|
|
// Ugly. Just ugly.
|
|
// `model` is a reference on a unknown component!
|
|
// See usage with SearchBox.
|
|
implicitHeight: {
|
|
var height = model.count * entryHeight
|
|
return height > maxMenuHeight ? maxMenuHeight : height
|
|
}
|
|
visible: false
|
|
z: Constants.zPopup
|
|
|
|
Rectangle {
|
|
id: content
|
|
|
|
anchors.fill: parent
|
|
color: PopupStyle.backgroundColor
|
|
|
|
layer {
|
|
enabled: true
|
|
effect: PopupShadow { }
|
|
}
|
|
}
|
|
}
|