openImageViewer(): take an optional callback
This commit is contained in:
parent
066102e64d
commit
2001fcf70a
1
TODO.md
1
TODO.md
@ -2,7 +2,6 @@
|
||||
|
||||
- Image viewer:
|
||||
- fix gifs
|
||||
- double click on EventImage to open fullscreen
|
||||
- open externally in context menu in timeline thumbnail
|
||||
- hflickable support kinetic scrolling disabler and speed/decel settings
|
||||
- buttons
|
||||
|
@ -66,11 +66,11 @@ HMxcImage {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
acceptedModifiers: Qt.NoModifier
|
||||
gesturePolicy: TapHandler.ReleaseWithinBounds
|
||||
|
||||
onTapped:
|
||||
eventList.selectedCount ?
|
||||
eventDelegate.toggleChecked() :
|
||||
eventList.openImageViewer(singleMediaInfo)
|
||||
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
|
@ -355,7 +355,7 @@ Rectangle {
|
||||
) || utils.urlFileName(event.media_url)
|
||||
}
|
||||
|
||||
function openImageViewer(event, forLink="") {
|
||||
function openImageViewer(event, forLink="", callback=null) {
|
||||
// if forLink is empty, this must be a media event
|
||||
|
||||
const title =
|
||||
@ -390,11 +390,13 @@ Rectangle {
|
||||
)
|
||||
},
|
||||
obj => {
|
||||
obj.openExternallyRequested.connect(() =>
|
||||
obj.openExternallyRequested.connect(() => {
|
||||
forLink ?
|
||||
Qt.openUrlExternally(forLink) :
|
||||
eventList.openMediaExternally(event)
|
||||
)
|
||||
})
|
||||
|
||||
if (callback) callback(obj)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user