mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Make images always fit the timeline
This commit is contained in:
parent
9c1912ed93
commit
a73ed771fa
1 changed files with 7 additions and 2 deletions
|
@ -3,8 +3,13 @@ import QtQuick 2.6
|
||||||
import im.nheko 1.0
|
import im.nheko 1.0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: Math.min(parent ? parent.width : undefined, model.width)
|
property double tempWidth: Math.min(parent ? parent.width : undefined, model.width)
|
||||||
height: width * model.proportionalHeight
|
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 {
|
Image {
|
||||||
id: img
|
id: img
|
||||||
|
|
Loading…
Reference in a new issue