diff --git a/src/singletons/TooltipPreviewImage.cpp b/src/singletons/TooltipPreviewImage.cpp index b2d0445a4..99cd9548b 100644 --- a/src/singletons/TooltipPreviewImage.cpp +++ b/src/singletons/TooltipPreviewImage.cpp @@ -5,28 +5,33 @@ #include "widgets/TooltipWidget.hpp" namespace chatterino { - TooltipPreviewImage &TooltipPreviewImage::getInstance() { - static TooltipPreviewImage *instance = new TooltipPreviewImage(); - return *instance; - } +TooltipPreviewImage &TooltipPreviewImage::getInstance() +{ + static TooltipPreviewImage *instance = new TooltipPreviewImage(); + return *instance; +} - TooltipPreviewImage::TooltipPreviewImage() { - connections_.push_back(getApp()->windows->gifRepaintRequested.connect( - [&] { - auto tooltipWidget = TooltipWidget::getInstance(); - if (this->image_ && !tooltipWidget->isHidden()) { - auto pixmap = this->image_->pixmap(); - if (pixmap) { - tooltipWidget->setImage(*pixmap); - } - } else { - tooltipWidget->clearImage(); +TooltipPreviewImage::TooltipPreviewImage() +{ + connections_.push_back(getApp()->windows->gifRepaintRequested.connect([&] { + auto tooltipWidget = TooltipWidget::getInstance(); + if (this->image_ && !tooltipWidget->isHidden()) + { + auto pixmap = this->image_->pixmap(); + if (pixmap) + { + tooltipWidget->setImage(*pixmap); } - })); + } + else + { + tooltipWidget->clearImage(); + } + })); +} - } - - void TooltipPreviewImage::setImage(ImagePtr image) { - this->image_ = image; - } +void TooltipPreviewImage::setImage(ImagePtr image) +{ + this->image_ = image; +} } // namespace chatterino diff --git a/src/singletons/TooltipPreviewImage.hpp b/src/singletons/TooltipPreviewImage.hpp index a56a37888..67ba9cd95 100644 --- a/src/singletons/TooltipPreviewImage.hpp +++ b/src/singletons/TooltipPreviewImage.hpp @@ -3,18 +3,19 @@ #include "messages/Image.hpp" namespace chatterino { - class TooltipPreviewImage { - public: - static TooltipPreviewImage &getInstance(); - void setImage(ImagePtr image); +class TooltipPreviewImage +{ +public: + static TooltipPreviewImage &getInstance(); + void setImage(ImagePtr image); - TooltipPreviewImage(const TooltipPreviewImage&) = delete; + TooltipPreviewImage(const TooltipPreviewImage &) = delete; - private: - TooltipPreviewImage(); +private: + TooltipPreviewImage(); - private: - ImagePtr image_ = nullptr; - std::vector connections_; - }; +private: + ImagePtr image_ = nullptr; + std::vector connections_; +}; } // namespace chatterino