Fix popup opening at wrong place

fixes #512
This commit is contained in:
Nicolas Werner 2021-03-07 18:23:50 +01:00
parent c03f716e8b
commit 3da9c45df2
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
2 changed files with 4 additions and 7 deletions

View File

@ -28,11 +28,11 @@ Item {
TapHandler { TapHandler {
acceptedButtons: Qt.RightButton acceptedButtons: Qt.RightButton
onSingleTapped: messageContextMenu.show(model.id, model.type, model.isEncrypted, model.isEditable, row, mapToItem(timelineRoot, eventPoint.position.x, eventPoint.position.y)) onSingleTapped: messageContextMenu.show(model.id, model.type, model.isEncrypted, model.isEditable, row)
} }
TapHandler { TapHandler {
onLongPressed: messageContextMenu.show(model.id, model.type, model.isEncrypted, model.isEditable, row, mapToItem(timelineRoot, point.position.x, point.position.y)) onLongPressed: messageContextMenu.show(model.id, model.type, model.isEncrypted, model.isEditable, row)
onDoubleTapped: chat.model.reply = model.id onDoubleTapped: chat.model.reply = model.id
} }

View File

@ -80,14 +80,11 @@ Page {
property bool isEncrypted property bool isEncrypted
property bool isEditable property bool isEditable
function show(eventId_, eventType_, isEncrypted_, isEditable_, showAt_, position) { function show(eventId_, eventType_, isEncrypted_, isEditable_, showAt_) {
eventId = eventId_; eventId = eventId_;
eventType = eventType_; eventType = eventType_;
isEncrypted = isEncrypted_; isEncrypted = isEncrypted_;
isEditable = isEditable_; isEditable = isEditable_;
if (position)
popup(position, showAt_);
else
popup(showAt_); popup(showAt_);
} }