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 leftMargin: messageListItem.isOwnMessage ? precalculatedValues.pageMarginDouble : 0
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
height: messageTextColumn.height + precalculatedValues.paddingMediumDouble height: messageTextColumn.height + precalculatedValues.paddingMediumDouble
width: precalculatedValues.backgroundWidth width: precalculatedValues.backgroundWidth
property bool isUnread: index > chatModel.getLastReadMessageIndex() property bool isUnread: index > chatModel.getLastReadMessageIndex()
color: isUnread ? Theme.secondaryHighlightColor : Theme.secondaryColor color: isUnread ? Theme.secondaryHighlightColor : Theme.secondaryColor
@ -391,10 +391,6 @@ ListItem {
WebPagePreview { WebPagePreview {
id: webPagePreview id: webPagePreview
Component.onCompleted: {
webPagePreviewLoader.height = 0;
}
onImplicitHeightChanged: { onImplicitHeightChanged: {
webPagePreviewLoader.height = webPagePreview.implicitHeight; 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> <translation>Download fehlgeschlagen.</translation>
</message> </message>
</context> </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> <context>
<name>functions</name> <name>functions</name>
<message> <message>

View file

@ -1158,6 +1158,13 @@
<translation>Download failed.</translation> <translation>Download failed.</translation>
</message> </message>
</context> </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> <context>
<name>functions</name> <name>functions</name>
<message> <message>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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