Merge pull request #224 from monich/image-click
Fixed long tap on an image
This commit is contained in:
commit
01d3ff18cf
2 changed files with 16 additions and 9 deletions
|
@ -32,6 +32,13 @@ Item {
|
|||
width: parent.width
|
||||
height: singleImage.visible ? Math.min(defaultHeight, singleImage.bestHeight + Theme.paddingSmall) : defaultHeight
|
||||
|
||||
function clicked() {
|
||||
pageStack.push(Qt.resolvedUrl("../pages/ImagePage.qml"), {
|
||||
"photoData" : imagePreviewItem.photoData,
|
||||
"pictureFileInformation" : imageFile.fileInformation
|
||||
})
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (photoData) {
|
||||
// Check first which size fits best...
|
||||
|
@ -68,15 +75,6 @@ Item {
|
|||
visible: status === Image.Ready
|
||||
opacity: visible ? 1 : 0
|
||||
Behavior on opacity { FadeAnimation {} }
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
pageStack.push(Qt.resolvedUrl("../pages/ImagePage.qml"), {
|
||||
"photoData" : imagePreviewItem.photoData,
|
||||
"pictureFileInformation" : imageFile.fileInformation
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BackgroundImage {
|
||||
|
|
|
@ -47,6 +47,15 @@ ListItem {
|
|||
onClicked: {
|
||||
if(messageListItem.precalculatedValues.pageIsSelecting) {
|
||||
page.toggleMessageSelection(myMessage);
|
||||
} 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)) {
|
||||
extraContent.clicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue