Fix clicking in image viewer always closing GIFs

This commit is contained in:
miruka 2020-07-19 16:02:38 -04:00
parent 465d31790f
commit 2dbb155a22
3 changed files with 12 additions and 6 deletions

View File

@ -2,7 +2,6 @@
- Image viewer: - Image viewer:
- open externally in context menu in timeline thumbnail - open externally in context menu in timeline thumbnail
- fix: gif always closes?
- hflickable support kinetic scrolling disabler and speed/decel settings - hflickable support kinetic scrolling disabler and speed/decel settings
- buttons - buttons
- keyboard controls - keyboard controls

View File

@ -20,6 +20,12 @@ Image {
readonly property int circleRadius: readonly property int circleRadius:
Math.ceil(Math.max(image.width, image.height)) Math.ceil(Math.max(image.width, image.height))
readonly property int animatedPaintedWidth:
animatedLoader.item ? animatedLoader.item.paintedWidth : 0
readonly property int animatedPaintedHeight:
animatedLoader.item ? animatedLoader.item.paintedHeight : 0
function reload() { function reload() {
// Can be reimplemented in components inheriting HImage // Can be reimplemented in components inheriting HImage
const oldSource = source const oldSource = source
@ -99,6 +105,7 @@ Image {
} }
HLoader { HLoader {
id: animatedLoader
anchors.fill: parent anchors.fill: parent
sourceComponent: animate && animated ? animatedImageComponent : null sourceComponent: animate && animated ? animatedImageComponent : null
} }

View File

@ -28,14 +28,14 @@ HPopup {
overallSize.height == window.height overallSize.height == window.height
readonly property int paintedWidth: readonly property int paintedWidth:
full.status === Image.Ready? full.status === Image.Ready ?
full.paintedWidth : full.animatedPaintedWidth || full.paintedWidth :
thumbnail.paintedWidth thumbnail.animatedPaintedWidth || thumbnail.paintedWidth
readonly property int paintedHeight: readonly property int paintedHeight:
full.status === Image.Ready ? full.status === Image.Ready ?
full.paintedHeight : full.animatedPaintedHeight || full.paintedHeight :
thumbnail.paintedHeight thumbnail.animatedPaintedHeight || thumbnail.paintedHeight
signal openExternallyRequested() signal openExternallyRequested()