Improve timeline GIF auto-pausing

Pause when any popup is covering the timeline (image viewer or not), and
work when opened by ctrl+o, not just when clicking the thumbnail.
This commit is contained in:
miruka 2020-07-20 19:50:39 -04:00
parent 93baaf51a0
commit 2fb4ad5eae
2 changed files with 6 additions and 7 deletions

View File

@ -1,7 +1,6 @@
# TODO
- Image viewer:
- stop timeline gif on ctrl+o
- open externally in context menu in timeline thumbnail
- hflickable support kinetic scrolling disabler and speed/decel settings
- keyboard controls

View File

@ -62,6 +62,11 @@ HMxcImage {
onCachedPathChanged:
eventList.thumbnailCachedPaths[loader.singleMediaInfo.id] = cachedPath
Binding on pause {
value: true
when: Object.keys(window.visiblePopups).length > 0
}
TapHandler {
acceptedButtons: Qt.LeftButton
acceptedModifiers: Qt.NoModifier
@ -73,12 +78,7 @@ HMxcImage {
return
}
const wasPaused = image.pause
image.pause = true
eventList.openImageViewer(singleMediaInfo, "", popup => {
popup.closed.connect(() => image.pause = wasPaused)
})
eventList.openImageViewer(singleMediaInfo)
}
}