diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index 0d53a9b7c..b89f0a46b 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -1217,21 +1217,27 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event) } else { - if (auto pixmap = hoverLayoutElement->imagePreview()) { - QBuffer buffer; - pixmap->save(&buffer, "PNG"); + auto emoteElement = dynamic_cast(&hoverLayoutElement->getCreator()); - // FIXME: Image inside of imageLayoutElement is not always the biggest - // FIXME: Inject image directly into tooltipWidget without base64 bs - // FIXME: Gifs are not animated - // FIXME: No way to opt-out + if (emoteElement) { + auto pixmap = emoteElement->getEmote()->images.getImage(3.0)->pixmap(); + if (pixmap) { + QBuffer buffer; + pixmap->save(&buffer, "PNG"); - tooltipWidget->setText( - QString("
%2x%3
%4") - .arg(QString(buffer.data().toBase64())) - .arg(pixmap->width()) - .arg(pixmap->height()) - .arg(tooltip)); + // FIXME: Inject image directly into tooltipWidget without base64 bs + // FIXME: Gifs are not animated + // FIXME: No way to opt-out + + tooltipWidget->setText( + QString("
%2x%3
%4") + .arg(QString(buffer.data().toBase64())) + .arg(pixmap->width()) + .arg(pixmap->height()) + .arg(tooltip)); + } else { + tooltipWidget->setText(tooltip); + } } else { tooltipWidget->setText(tooltip); }