fix(Components): more popup menu position fine-tuning

This commit is contained in:
Pascal Precht 2021-06-09 11:24:38 +02:00 committed by Michał Cieślak
parent 33082a761b
commit 30956a757d
2 changed files with 5 additions and 2 deletions

View File

@ -35,7 +35,9 @@ Column {
onMenuButtonClicked: {
highlighted = true
menuButton.highlighted = true
popupMenuSlot.item.popup()
let p = menuButton.mapToItem(statusChatListCategoryItem, menuButton.x, menuButton.y)
let menuWidth = popupMenuSlot.item.width
popupMenuSlot.item.popup(p.x - menuWidth, p.y + menuButton.height + 4)
}
}

View File

@ -55,7 +55,8 @@ Rectangle {
onClicked: {
statusChatToolBar.menuButtonClicked()
highlighted = true
popupMenuSlot.item.popup(actionButtons.x + menuButton.width - popupMenuSlot.item.width, menuButton.height + 4)
let p = menuButton.mapToItem(statusChatToolBar, menuButton.x, menuButton.y)
popupMenuSlot.item.popup(p.x + menuButton.width - popupMenuSlot.item.width, p.y + 4 + menuButton.height)
}
}