mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Get the biggest version of emote from EmoteElement
This commit is contained in:
parent
959aa4616f
commit
7251a20dfb
1 changed files with 19 additions and 13 deletions
|
@ -1217,21 +1217,27 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (auto pixmap = hoverLayoutElement->imagePreview()) {
|
auto emoteElement = dynamic_cast<const EmoteElement*>(&hoverLayoutElement->getCreator());
|
||||||
QBuffer buffer;
|
|
||||||
pixmap->save(&buffer, "PNG");
|
|
||||||
|
|
||||||
// FIXME: Image inside of imageLayoutElement is not always the biggest
|
if (emoteElement) {
|
||||||
// FIXME: Inject image directly into tooltipWidget without base64 bs
|
auto pixmap = emoteElement->getEmote()->images.getImage(3.0)->pixmap();
|
||||||
// FIXME: Gifs are not animated
|
if (pixmap) {
|
||||||
// FIXME: No way to opt-out
|
QBuffer buffer;
|
||||||
|
pixmap->save(&buffer, "PNG");
|
||||||
|
|
||||||
tooltipWidget->setText(
|
// FIXME: Inject image directly into tooltipWidget without base64 bs
|
||||||
QString("<img src='data:image/png;base64,%1' /><br/>%2x%3<br/>%4")
|
// FIXME: Gifs are not animated
|
||||||
.arg(QString(buffer.data().toBase64()))
|
// FIXME: No way to opt-out
|
||||||
.arg(pixmap->width())
|
|
||||||
.arg(pixmap->height())
|
tooltipWidget->setText(
|
||||||
.arg(tooltip));
|
QString("<img src='data:image/png;base64,%1' /><br/>%2x%3<br/>%4")
|
||||||
|
.arg(QString(buffer.data().toBase64()))
|
||||||
|
.arg(pixmap->width())
|
||||||
|
.arg(pixmap->height())
|
||||||
|
.arg(tooltip));
|
||||||
|
} else {
|
||||||
|
tooltipWidget->setText(tooltip);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
tooltipWidget->setText(tooltip);
|
tooltipWidget->setText(tooltip);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue