From 22eaf6fa997caaf4799bef2f7c81ac9d89237895 Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Wed, 9 Jun 2021 11:24:38 +0200 Subject: [PATCH] fix(Components): more popup menu position fine-tuning --- src/StatusQ/Components/StatusChatListCategory.qml | 4 +++- src/StatusQ/Components/StatusChatToolBar.qml | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/StatusQ/Components/StatusChatListCategory.qml b/src/StatusQ/Components/StatusChatListCategory.qml index 00d1337a..076a850a 100644 --- a/src/StatusQ/Components/StatusChatListCategory.qml +++ b/src/StatusQ/Components/StatusChatListCategory.qml @@ -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) } } diff --git a/src/StatusQ/Components/StatusChatToolBar.qml b/src/StatusQ/Components/StatusChatToolBar.qml index 93b243e9..b373d56b 100644 --- a/src/StatusQ/Components/StatusChatToolBar.qml +++ b/src/StatusQ/Components/StatusChatToolBar.qml @@ -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) } }