Fix erroneous display for some web page previews

This commit is contained in:
Sebastian Wolf 2020-11-16 15:12:18 +01:00
parent aeca799006
commit 6e6396eac4
13 changed files with 93 additions and 5 deletions

View file

@ -227,7 +227,7 @@ ListItem {
leftMargin: messageListItem.isOwnMessage ? precalculatedValues.pageMarginDouble : 0
verticalCenter: parent.verticalCenter
}
height: messageTextColumn.height + precalculatedValues.paddingMediumDouble
height: messageTextColumn.height + precalculatedValues.paddingMediumDouble
width: precalculatedValues.backgroundWidth
property bool isUnread: index > chatModel.getLastReadMessageIndex()
color: isUnread ? Theme.secondaryHighlightColor : Theme.secondaryColor
@ -391,10 +391,6 @@ ListItem {
WebPagePreview {
id: webPagePreview
Component.onCompleted: {
webPagePreviewLoader.height = 0;
}
onImplicitHeightChanged: {
webPagePreviewLoader.height = webPagePreview.implicitHeight;
}

View file

@ -145,4 +145,19 @@ Column {
}
}
Text {
id: noPreviewAvailableText
width: parent.width
text: qsTr("Preview not supported for this link...")
font.pixelSize: Theme.fontSizeTiny
font.italic: true
color: Theme.secondaryColor
elide: Text.ElideRight
wrapMode: Text.Wrap
maximumLineCount: 1
textFormat: Text.StyledText
visible: !siteNameText.visible && !titleText.visible && !descriptionText.visible && !webPagePreviewImageItem.visible
}
}

View file

@ -1158,6 +1158,13 @@
<translation>Download fehlgeschlagen.</translation>
</message>
</context>
<context>
<name>WebPagePreview</name>
<message>
<source>Preview not supported for this link...</source>
<translation>Vorschau wird für diesen Link nicht unterstützt...</translation>
</message>
</context>
<context>
<name>functions</name>
<message>

View file

@ -1158,6 +1158,13 @@
<translation>Download failed.</translation>
</message>
</context>
<context>
<name>WebPagePreview</name>
<message>
<source>Preview not supported for this link...</source>
<translation>Preview not supported for this link...</translation>
</message>
</context>
<context>
<name>functions</name>
<message>

View file

@ -1148,6 +1148,13 @@
<translation>Error al bajar</translation>
</message>
</context>
<context>
<name>WebPagePreview</name>
<message>
<source>Preview not supported for this link...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>functions</name>
<message>

View file

@ -1159,6 +1159,13 @@
<translation>Lataus epäonnistui.</translation>
</message>
</context>
<context>
<name>WebPagePreview</name>
<message>
<source>Preview not supported for this link...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>functions</name>
<message>

View file

@ -1148,6 +1148,13 @@
<translation>A letöltés nem sikerült.</translation>
</message>
</context>
<context>
<name>WebPagePreview</name>
<message>
<source>Preview not supported for this link...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>functions</name>
<message>

View file

@ -1158,6 +1158,13 @@
<translation>Download non riuscito.</translation>
</message>
</context>
<context>
<name>WebPagePreview</name>
<message>
<source>Preview not supported for this link...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>functions</name>
<message>

View file

@ -1168,6 +1168,13 @@
<translation>Nieudane pobieranie</translation>
</message>
</context>
<context>
<name>WebPagePreview</name>
<message>
<source>Preview not supported for this link...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>functions</name>
<message>

View file

@ -1168,6 +1168,13 @@
<translation>Ошибка скачивания.</translation>
</message>
</context>
<context>
<name>WebPagePreview</name>
<message>
<source>Preview not supported for this link...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>functions</name>
<message>

View file

@ -1158,6 +1158,13 @@
<translation>Nerladdning misslyckades.</translation>
</message>
</context>
<context>
<name>WebPagePreview</name>
<message>
<source>Preview not supported for this link...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>functions</name>
<message>

View file

@ -1148,6 +1148,13 @@
<translation></translation>
</message>
</context>
<context>
<name>WebPagePreview</name>
<message>
<source>Preview not supported for this link...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>functions</name>
<message>

View file

@ -1148,6 +1148,13 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>WebPagePreview</name>
<message>
<source>Preview not supported for this link...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>functions</name>
<message>