fix(@desktop/chat) keep message hover effect while context menu open

- keep context menu when emoji reaction clicked
- move Connections out of Loader

Fixes #6633
This commit is contained in:
PavelS 2022-08-01 19:03:49 +03:00 committed by PavelS
parent e5358bf29a
commit 368b29bb38
2 changed files with 9 additions and 10 deletions

View File

@ -113,6 +113,10 @@ Item {
onHoverChanged: {
hovered && setHovered(messageId, hovered)
}
onSetMessageActive: {
root.setMessageActive(messageId, active)
}
anchors.right: parent.right
anchors.rightMargin: 20
anchors.top: messageContainer.top
@ -160,15 +164,11 @@ Item {
}
}
Loader {
active: typeof root.messageContextMenu !== "undefined"
sourceComponent: Component {
Connections {
enabled: isMessageActive
target: root.messageContextMenu
onClosed: root.setMessageActive(messageId, false)
}
}
Connections {
enabled: isHovered || isMessageActive
target: typeof root.messageContextMenu !== "undefined" ? root.messageContextMenu : null
onOpened: root.setMessageActive(messageId, true)
onClosed: root.setMessageActive(messageId, false)
}
DateGroup {

View File

@ -185,7 +185,6 @@ StatusPopupMenu {
reactedByUser: !!root.emojiReactionsReactedByUser[model.emojiId]
onCloseModal: {
root.toggleReaction(root.messageId, emojiId)
root.close()
}
}
}