Make images always fit the timeline

remotes/origin/0.7.0-dev
Nicolas Werner 5 years ago
parent 9c1912ed93
commit a73ed771fa
  1. 9
      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

Loading…
Cancel
Save