mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
Fix popup display
This commit is contained in:
parent
fbb83249b8
commit
6d96359b0a
2 changed files with 7 additions and 8 deletions
|
|
@ -14,9 +14,6 @@ Window {
|
|||
// TODO : handle this bool when security mode is implemented
|
||||
property bool firstConnection: true
|
||||
|
||||
// access window properties from all its children
|
||||
// (used in popupbutton to see if the popup exceed window height)
|
||||
property Window mainApplicationWindow: mainWindow
|
||||
|
||||
function goToNewCall() {
|
||||
mainWindowStackView.replace(mainPage, StackView.Immediate)
|
||||
|
|
|
|||
|
|
@ -34,13 +34,15 @@ Button {
|
|||
x: - width
|
||||
y: mainItem.height
|
||||
closePolicy: Popup.CloseOnPressOutsideParent |Popup.CloseOnPressOutside
|
||||
parent: mainItem // Explicit define for coordinates references.
|
||||
|
||||
onAboutToShow: {
|
||||
if (mainApplicationWindow == undefined) return;
|
||||
var coord = mapToGlobal(mainItem.x, mainItem.y)
|
||||
if (coord.y + popup.height >= mainApplicationWindow.height) {
|
||||
y = -popup.height
|
||||
} else {
|
||||
// Do not use popup.height as it is not consistent.
|
||||
var position = mainItem.mapToItem(mainItem.Window.contentItem, mainItem.x, mainItem.y + mainItem.height + popup.implicitContentHeight + popup.padding)
|
||||
if (position.y >= mainItem.Window.height) {
|
||||
position = mainItem.Window.contentItem.mapToItem(mainItem, 0,0)
|
||||
y = position.y
|
||||
}else {
|
||||
y = mainItem.height
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue