From 7aed6d2e44d176bd3aee3f523648b862e02a7e34 Mon Sep 17 00:00:00 2001 From: James Graham Date: Thu, 10 Nov 2022 18:49:52 +0000 Subject: [PATCH] Apply max image size so they don't become huge in compact mode. Set max size to gridUnits * 30. The aim is to allow them to be generally bigger than bubble mode but not so huge that they take up the entire screen BUG: 454878 --- src/qml/Component/Timeline/ImageDelegate.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qml/Component/Timeline/ImageDelegate.qml b/src/qml/Component/Timeline/ImageDelegate.qml index 9fbca5951..2c7db8b68 100644 --- a/src/qml/Component/Timeline/ImageDelegate.qml +++ b/src/qml/Component/Timeline/ImageDelegate.qml @@ -29,11 +29,13 @@ TimelineContainer { readonly property var info: content.info readonly property string mediaId: isThumbnail ? content.thumbnailMediaId : content.mediaId + readonly property var maxWidth: Kirigami.Units.gridUnit * 30 + innerObject: Image { id: img - Layout.maximumWidth: imageDelegate.contentMaxWidth - Layout.maximumHeight: imageDelegate.contentMaxWidth / sourceSize.width * sourceSize.height + Layout.maximumWidth: Math.min(imageDelegate.contentMaxWidth, imageDelegate.maxWidth) + Layout.maximumHeight: Math.min(imageDelegate.contentMaxWidth / sourceSize.width * sourceSize.height, imageDelegate.maxWidth / sourceSize.width * sourceSize.height) Layout.preferredWidth: imageDelegate.info.w > 0 ? imageDelegate.info.w : sourceSize.width Layout.preferredHeight: imageDelegate.info.h > 0 ? imageDelegate.info.h : sourceSize.height source: model.mediaUrl