From 465d31790f03dea157d2eccd327721dde0da2987 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 19 Jul 2020 15:44:03 -0400 Subject: [PATCH] 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 --- TODO.md | 1 - src/gui/Pages/Chat/Timeline/EventImage.qml | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/TODO.md b/TODO.md index d7662644..eb735338 100644 --- a/TODO.md +++ b/TODO.md @@ -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 diff --git a/src/gui/Pages/Chat/Timeline/EventImage.qml b/src/gui/Pages/Chat/Timeline/EventImage.qml index 155a296e..71d53f5e 100644 --- a/src/gui/Pages/Chat/Timeline/EventImage.qml +++ b/src/gui/Pages/Chat/Timeline/EventImage.qml @@ -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) },