Add thumbnails to link tooltips if available (#1664)
This feature is off by default and can be enabled in the settings with the "Show link thumbnail" setting. This feature also requires the "Show link info when hovering" setting to be enabled. thumbnails support is only there for direct image links, twitch clips, and youtube links. can be expanded in the future in the /api repo Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -40,6 +40,18 @@ MessageElement *MessageElement::setTooltip(const QString &tooltip)
|
||||
return this;
|
||||
}
|
||||
|
||||
MessageElement *MessageElement::setThumbnail(const ImagePtr &thumbnail)
|
||||
{
|
||||
this->thumbnail_ = thumbnail;
|
||||
return this;
|
||||
}
|
||||
|
||||
MessageElement *MessageElement::setThumbnailType(const ThumbnailType type)
|
||||
{
|
||||
this->thumbnailType_ = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
MessageElement *MessageElement::setTrailingSpace(bool value)
|
||||
{
|
||||
this->trailingSpace = value;
|
||||
@@ -51,6 +63,16 @@ const QString &MessageElement::getTooltip() const
|
||||
return this->tooltip_;
|
||||
}
|
||||
|
||||
const ImagePtr &MessageElement::getThumbnail() const
|
||||
{
|
||||
return this->thumbnail_;
|
||||
}
|
||||
|
||||
const MessageElement::ThumbnailType &MessageElement::getThumbnailType() const
|
||||
{
|
||||
return this->thumbnailType_;
|
||||
}
|
||||
|
||||
const Link &MessageElement::getLink() const
|
||||
{
|
||||
return this->link_;
|
||||
|
||||
Reference in New Issue
Block a user