Preview images instead of emotes
This commit is contained in:
@@ -313,8 +313,8 @@ void ChannelView::queueUpdate()
|
|||||||
// this->repaint();
|
// this->repaint();
|
||||||
|
|
||||||
auto tooltipWidget = TooltipWidget::getInstance();
|
auto tooltipWidget = TooltipWidget::getInstance();
|
||||||
if (this->currentPreviewEmote) {
|
if (this->currentPreviewImage) {
|
||||||
auto pixmap = this->currentPreviewEmote->images.getImage(3.0)->pixmap();
|
auto pixmap = this->currentPreviewImage->pixmap();
|
||||||
if (pixmap) {
|
if (pixmap) {
|
||||||
tooltipWidget->setImage(*pixmap);
|
tooltipWidget->setImage(*pixmap);
|
||||||
}
|
}
|
||||||
@@ -1228,9 +1228,9 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
|
|||||||
{
|
{
|
||||||
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()) {
|
||||||
this->currentPreviewEmote = emoteElement->getEmote();
|
this->currentPreviewImage = emoteElement->getEmote()->images.getImage(3.0);
|
||||||
} else {
|
} else {
|
||||||
this->currentPreviewEmote = nullptr;
|
this->currentPreviewImage = nullptr;
|
||||||
tooltipWidget->clearImage();
|
tooltipWidget->clearImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +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 "messages/Image.hpp"
|
||||||
#include "widgets/BaseWidget.hpp"
|
#include "widgets/BaseWidget.hpp"
|
||||||
|
|
||||||
#include <QPaintEvent>
|
#include <QPaintEvent>
|
||||||
@@ -210,7 +210,7 @@ private:
|
|||||||
static constexpr int leftPadding = 8;
|
static constexpr int leftPadding = 8;
|
||||||
static constexpr int scrollbarPadding = 8;
|
static constexpr int scrollbarPadding = 8;
|
||||||
|
|
||||||
EmotePtr currentPreviewEmote = nullptr;
|
ImagePtr currentPreviewImage = nullptr;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void wordFlagsChanged()
|
void wordFlagsChanged()
|
||||||
|
|||||||
Reference in New Issue
Block a user