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();
|
auto statusCode = root.value("status").toInt();
|
||||||
QString response = QString();
|
QString response = QString();
|
||||||
QString linkString = url;
|
QString linkString = url;
|
||||||
ImagePtr thumbnail =
|
ImagePtr thumbnail = nullptr;
|
||||||
Image::fromUrl({root.value("thumbnail").toString()});
|
|
||||||
if (statusCode == 200)
|
if (statusCode == 200)
|
||||||
{
|
{
|
||||||
response = root.value("tooltip").toString();
|
response = root.value("tooltip").toString();
|
||||||
|
thumbnail =
|
||||||
|
Image::fromUrl({root.value("thumbnail").toString()});
|
||||||
if (getSettings()->unshortLinks)
|
if (getSettings()->unshortLinks)
|
||||||
{
|
{
|
||||||
linkString = root.value("link").toString();
|
linkString = root.value("link").toString();
|
||||||
|
|
|
@ -1458,12 +1458,14 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const auto isHideLink =
|
const auto shouldHideThumbnail =
|
||||||
isInStreamerMode() &&
|
isInStreamerMode() &&
|
||||||
getSettings()->streamerModeHideLinkThumbnails &&
|
getSettings()->streamerModeHideLinkThumbnails &&
|
||||||
(!element->getThumbnail()->url().string.isEmpty());
|
element->getThumbnail() != nullptr &&
|
||||||
|
!element->getThumbnail()->url().string.isEmpty();
|
||||||
auto thumb =
|
auto thumb =
|
||||||
isHideLink ? Image::fromPixmap(getResources().streamerMode)
|
shouldHideThumbnail
|
||||||
|
? Image::fromPixmap(getResources().streamerMode)
|
||||||
: element->getThumbnail();
|
: element->getThumbnail();
|
||||||
tooltipPreviewImage.setImage(std::move(thumb));
|
tooltipPreviewImage.setImage(std::move(thumb));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue