mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-17 01:51:24 +00:00
fix(Chat/ReactionDialog): The reaction dialog is shown in different places
Changed x and y assignment trigger to get the correct value once the position depends on the own popup height. Fixes #6264
This commit is contained in:
parent
1c30eff74b
commit
47897f431f
@ -764,11 +764,14 @@ Item {
|
||||
onAddEmojiClicked: {
|
||||
if(root.isChatBlocked)
|
||||
return
|
||||
|
||||
// First set parent, X & Y positions for the messageContextMenu
|
||||
root.messageContextMenu.parent = emojiRect
|
||||
root.messageContextMenu.setXPosition = function() { return (root.messageContextMenu.parent.x + root.messageContextMenu.parent.width + 4) }
|
||||
root.messageContextMenu.setYPosition = function() { return (-root.messageContextMenu.height - 4) }
|
||||
|
||||
// Second, add emoji that also triggers setXYPosition methods / open popup:
|
||||
root.addEmoji(false, false, false, null, true, false);
|
||||
// Set parent, X & Y positions for the messageContextMenu
|
||||
root.messageContextMenu.parent = emojiReactionLoader
|
||||
root.messageContextMenu.setXPosition = function() { return (root.messageContextMenu.parent.x + 4)}
|
||||
root.messageContextMenu.setYPosition = function() { return (-root.messageContextMenu.height - 4)}
|
||||
}
|
||||
|
||||
onToggleReaction: {
|
||||
|
@ -102,6 +102,11 @@ StatusPopupMenu {
|
||||
|
||||
onHeightChanged: { root.y = setYPosition(); }
|
||||
onWidthChanged: { root.x = setXPosition(); }
|
||||
onOpened: {
|
||||
// Trigger x and y position:
|
||||
x = setXPosition()
|
||||
y = setYPosition()
|
||||
}
|
||||
|
||||
width: Math.max(emojiContainer.visible ? emojiContainer.width : 0, 200)
|
||||
|
||||
|
@ -212,10 +212,6 @@ Loader {
|
||||
messageContextMenu.selectedUserIcon = obj.senderIconToShow
|
||||
}
|
||||
|
||||
|
||||
messageContextMenu.x = messageContextMenu.setXPosition()
|
||||
messageContextMenu.y = messageContextMenu.setYPosition()
|
||||
|
||||
messageContextMenu.popup()
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user