Image viewer: handle images without known w/h

There's no way to know in advance the real size for
HTTP image previews and m.image events sent by some clients
This commit is contained in:
miruka 2020-07-19 15:44:03 -04:00
parent 6b1a5a46e6
commit 465d31790f
2 changed files with 6 additions and 3 deletions

View File

@ -1,7 +1,6 @@
# TODO
- Image viewer:
- support http urls
- open externally in context menu in timeline thumbnail
- fix: gif always closes?
- hflickable support kinetic scrolling disabler and speed/decel settings

View File

@ -84,10 +84,14 @@ HMxcImage {
overallSize: Qt.size(
loader.singleMediaInfo.media_width ||
loader.singleMediaInfo.thumbnail_width,
loader.singleMediaInfo.thumbnail_width ||
implicitWidth ||
800,
loader.singleMediaInfo.media_height ||
loader.singleMediaInfo.thumbnail_height,
loader.singleMediaInfo.thumbnail_height ||
implicitHeight ||
600,
)
},
obj => { obj.openExternallyRequested.connect(openUrlExternally) },