Merge pull request #361 from jgibbon/bugfix/extraContent_click

Fix click signal forwarding for extra content items
This commit is contained in:
Sebastian Wolf 2021-02-03 19:54:08 +01:00 committed by GitHub
commit a6e0c9b3ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,10 +56,7 @@ ListItem {
} else {
// Allow extra context to react to click
var extraContent = extraContentLoader.item
if (extraContent && ("clicked" in extraContent) && (typeof extraContent.clicked === "function") &&
mouseX >= extraContentLoader.x && mouseY >= extraContentLoader.y &&
mouseX < (extraContentLoader.x + extraContentLoader.width) &&
mouseY < (extraContentLoader.y + extraContentLoader.height)) {
if (extraContent && extraContentLoader.contains(mapToItem(extraContentLoader, mouse.x, mouse.y))) {
extraContent.clicked()
} else if (webPagePreviewLoader.item) {
webPagePreviewLoader.item.clicked()