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 # TODO
- Image viewer: - Image viewer:
- stop timeline gif on ctrl+o
- open externally in context menu in timeline thumbnail - open externally in context menu in timeline thumbnail
- hflickable support kinetic scrolling disabler and speed/decel settings - hflickable support kinetic scrolling disabler and speed/decel settings
- keyboard controls - keyboard controls

View File

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