summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-02-19 23:33:11 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-02-19 23:33:11 +0200
commit127c52e39a5455d574fcbffd75753b31897e4877 (patch)
tree16847e445836393906136dde4f5fb830034d6612 /include
parentMove scaleImage() in Utils (diff)
downloadnheko-127c52e39a5455d574fcbffd75753b31897e4877.tar.xz
Scale down the preview image to fit in the application window
On macOS the modal has some extra space around the main content
that might make it unusable with a big enough image.
Diffstat (limited to 'include')
-rw-r--r--include/Utils.h2
-rw-r--r--include/timeline/widgets/ImageItem.h5
2 files changed, 6 insertions, 1 deletions
diff --git a/include/Utils.h b/include/Utils.h

index fa825b7c..fba9bf67 100644 --- a/include/Utils.h +++ b/include/Utils.h
@@ -33,7 +33,7 @@ ImageType scaleDown(uint64_t max_width, uint64_t max_height, const ImageType &source) { if (source.isNull()) - return source; + return QPixmap(); auto width_ratio = (double)max_width / (double)source.width(); auto height_ratio = (double)max_height / (double)source.height(); diff --git a/include/timeline/widgets/ImageItem.h b/include/timeline/widgets/ImageItem.h
index 0069a9fe..21d91b52 100644 --- a/include/timeline/widgets/ImageItem.h +++ b/include/timeline/widgets/ImageItem.h
@@ -26,6 +26,10 @@ #include "MatrixClient.h" +namespace dialogs { +class ImageOverlay; +} + class ImageItem : public QWidget { Q_OBJECT @@ -75,4 +79,5 @@ private: mtx::events::RoomEvent<mtx::events::msg::Image> event_; QSharedPointer<MatrixClient> client_; + QSharedPointer<dialogs::ImageOverlay> image_dialog_; };