Restore option to disable emote images
Condensed into a single option, which will disable/enable all emote and emoji images Also moved badges into their own element
This commit is contained in:
@@ -138,10 +138,7 @@ void EmoteElement::addToContainer(MessageLayoutContainer &container,
|
||||
if (image->isEmpty())
|
||||
return;
|
||||
|
||||
auto emoteScale =
|
||||
this->getFlags().hasAny(MessageElementFlag::Badges)
|
||||
? 1
|
||||
: getSettings()->emoteScale.getValue();
|
||||
auto emoteScale = getSettings()->emoteScale.getValue();
|
||||
|
||||
auto size =
|
||||
QSize(int(container.getScale() * image->width() * emoteScale),
|
||||
@@ -161,6 +158,31 @@ void EmoteElement::addToContainer(MessageLayoutContainer &container,
|
||||
}
|
||||
}
|
||||
|
||||
// BADGE
|
||||
BadgeElement::BadgeElement(const EmotePtr &emote, MessageElementFlags flags)
|
||||
: MessageElement(flags)
|
||||
, emote_(emote)
|
||||
{
|
||||
this->setTooltip(emote->tooltip.string);
|
||||
}
|
||||
|
||||
void BadgeElement::addToContainer(MessageLayoutContainer &container,
|
||||
MessageElementFlags flags)
|
||||
{
|
||||
if (flags.hasAny(this->getFlags()))
|
||||
{
|
||||
auto image = this->emote_->images.getImage(container.getScale());
|
||||
if (image->isEmpty())
|
||||
return;
|
||||
|
||||
auto size = QSize(int(container.getScale() * image->width()),
|
||||
int(container.getScale() * image->height()));
|
||||
|
||||
container.addElement((new ImageLayoutElement(*this, image, size))
|
||||
->setLink(this->getLink()));
|
||||
}
|
||||
}
|
||||
|
||||
// TEXT
|
||||
TextElement::TextElement(const QString &text, MessageElementFlags flags,
|
||||
const MessageColor &color, FontStyle style)
|
||||
|
||||
Reference in New Issue
Block a user