mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Fixed thumbnails merging with link info without thumbnails (#2244)
This commit is contained in:
parent
5232cb535e
commit
8b2c3c7386
2 changed files with 9 additions and 6 deletions
|
@ -32,11 +32,12 @@ void LinkResolver::getLinkInfo(
|
|||
auto statusCode = root.value("status").toInt();
|
||||
QString response = QString();
|
||||
QString linkString = url;
|
||||
ImagePtr thumbnail =
|
||||
Image::fromUrl({root.value("thumbnail").toString()});
|
||||
ImagePtr thumbnail = nullptr;
|
||||
if (statusCode == 200)
|
||||
{
|
||||
response = root.value("tooltip").toString();
|
||||
thumbnail =
|
||||
Image::fromUrl({root.value("thumbnail").toString()});
|
||||
if (getSettings()->unshortLinks)
|
||||
{
|
||||
linkString = root.value("link").toString();
|
||||
|
|
|
@ -1458,13 +1458,15 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
|
|||
}
|
||||
else
|
||||
{
|
||||
const auto isHideLink =
|
||||
const auto shouldHideThumbnail =
|
||||
isInStreamerMode() &&
|
||||
getSettings()->streamerModeHideLinkThumbnails &&
|
||||
(!element->getThumbnail()->url().string.isEmpty());
|
||||
element->getThumbnail() != nullptr &&
|
||||
!element->getThumbnail()->url().string.isEmpty();
|
||||
auto thumb =
|
||||
isHideLink ? Image::fromPixmap(getResources().streamerMode)
|
||||
: element->getThumbnail();
|
||||
shouldHideThumbnail
|
||||
? Image::fromPixmap(getResources().streamerMode)
|
||||
: element->getThumbnail();
|
||||
tooltipPreviewImage.setImage(std::move(thumb));
|
||||
|
||||
if (element->getThumbnailType() ==
|
||||
|
|
Loading…
Reference in a new issue