mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Animate gifs in the tooltip preview
This commit is contained in:
parent
94e705ec1b
commit
a84716547b
2 changed files with 16 additions and 7 deletions
|
@ -311,6 +311,15 @@ void ChannelView::queueUpdate()
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// this->repaint();
|
// this->repaint();
|
||||||
|
|
||||||
|
auto tooltipWidget = TooltipWidget::getInstance();
|
||||||
|
if (this->currentPreviewEmote) {
|
||||||
|
auto pixmap = this->currentPreviewEmote->images.getImage(3.0)->pixmap();
|
||||||
|
if (pixmap) {
|
||||||
|
tooltipWidget->setImage(*pixmap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this->update();
|
this->update();
|
||||||
|
|
||||||
// this->updateTimer.start();
|
// this->updateTimer.start();
|
||||||
|
@ -1217,15 +1226,12 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tooltipWidget->clearImage();
|
|
||||||
|
|
||||||
auto emoteElement = dynamic_cast<const EmoteElement*>(&hoverLayoutElement->getCreator());
|
auto emoteElement = dynamic_cast<const EmoteElement*>(&hoverLayoutElement->getCreator());
|
||||||
if (emoteElement && getSettings()->emotesTooltipPreview.getValue()) {
|
if (emoteElement && getSettings()->emotesTooltipPreview.getValue()) {
|
||||||
auto pixmap = emoteElement->getEmote()->images.getImage(3.0)->pixmap();
|
this->currentPreviewEmote = emoteElement->getEmote();
|
||||||
if (pixmap) {
|
} else {
|
||||||
// FIXME: Gifs are not animated
|
this->currentPreviewEmote = nullptr;
|
||||||
tooltipWidget->setImage(*pixmap);
|
tooltipWidget->clearImage();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tooltipWidget->moveTo(this, event->globalPos());
|
tooltipWidget->moveTo(this, event->globalPos());
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "messages/LimitedQueue.hpp"
|
#include "messages/LimitedQueue.hpp"
|
||||||
#include "messages/LimitedQueueSnapshot.hpp"
|
#include "messages/LimitedQueueSnapshot.hpp"
|
||||||
#include "messages/Selection.hpp"
|
#include "messages/Selection.hpp"
|
||||||
|
#include "messages/Emote.hpp"
|
||||||
#include "widgets/BaseWidget.hpp"
|
#include "widgets/BaseWidget.hpp"
|
||||||
|
|
||||||
#include <QPaintEvent>
|
#include <QPaintEvent>
|
||||||
|
@ -209,6 +210,8 @@ private:
|
||||||
static constexpr int leftPadding = 8;
|
static constexpr int leftPadding = 8;
|
||||||
static constexpr int scrollbarPadding = 8;
|
static constexpr int scrollbarPadding = 8;
|
||||||
|
|
||||||
|
EmotePtr currentPreviewEmote = nullptr;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void wordFlagsChanged()
|
void wordFlagsChanged()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue