fix: fix top bar menu position

This commit is contained in:
Jonathan Rainville 2021-02-12 13:38:25 -05:00 committed by Iuri Matias
parent 6c272dddf6
commit 90e9e2d192
2 changed files with 9 additions and 4 deletions

View File

@ -109,7 +109,9 @@ Rectangle {
if (isPrivateGroupChat) {
menu.popup(moreActionsBtn.x, moreActionsBtn.height)
} else {
menu.openMenu(chatsModel.activeChannel, chatsModel.getActiveChannelIdx())
menu.openMenu(chatsModel.activeChannel, chatsModel.getActiveChannelIdx(),
moreActionsBtn.x - chatContextMenu.width + moreActionsBtn.width + 4,
moreActionsBtn.height - 4)
}
}
cursorShape: Qt.PointingHandCursor

View File

@ -25,15 +25,16 @@ PopupMenu {
}
]
function openMenu(channel, index) {
function openMenu(channel, index, x, y) {
channelContextMenu.contextChannel = channel
if (index !== undefined) {
channelContextMenu.channelIndex = index
}
channelContextMenu.popup()
channelContextMenu.popup(x, y)
}
Action {
id: viewProfileButton
enabled: channelContextMenu.contextChannel.chatType !== Constants.chatTypePublic
text: {
if (channelContextMenu.contextChannel.chatType === Constants.chatTypeOneToOne) {
@ -65,7 +66,9 @@ PopupMenu {
}
}
Separator {}
Separator {
visible: viewProfileButton.enabled
}
Action {
text: channelContextMenu.contextChannel.muted ?