summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/delegates/ImageMessage.qml9
1 files changed, 7 insertions, 2 deletions
diff --git a/resources/qml/delegates/ImageMessage.qml b/resources/qml/delegates/ImageMessage.qml
index 1b6e5729..15ce29b7 100644
--- a/resources/qml/delegates/ImageMessage.qml
+++ b/resources/qml/delegates/ImageMessage.qml
@@ -3,8 +3,13 @@ import QtQuick 2.6
 import im.nheko 1.0
 
 Item {
-	width: Math.min(parent ? parent.width : undefined, model.width)
-	height: width * model.proportionalHeight
+	property double tempWidth: Math.min(parent ? parent.width : undefined, model.width)
+	property double tempHeight: tempWidth * model.proportionalHeight
+
+	property bool tooHigh: tempHeight > chat.height - 40
+
+	height: tooHigh ? chat.height - 40 : tempHeight
+	width: tooHigh ? (chat.height - 40) / model.proportionalHeight : tempWidth
 
 	Image {
 		id: img