diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2019-12-13 02:16:12 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2019-12-13 02:16:12 +0100 |
commit | a73ed771fa9fabefe5199fb8aa269ac55a9a03c9 (patch) | |
tree | 797c4b81bdda68c5f5b4bf8a608a9cff3f6497a8 /resources/qml/delegates/ImageMessage.qml | |
parent | Fix preview of sent encrypted images (diff) | |
download | nheko-a73ed771fa9fabefe5199fb8aa269ac55a9a03c9.tar.xz |
Make images always fit the timeline
Diffstat (limited to 'resources/qml/delegates/ImageMessage.qml')
-rw-r--r-- | resources/qml/delegates/ImageMessage.qml | 9 |
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 |