fixed < in emote names breaking the <br> and tooltips on mac

This commit is contained in:
nuuls 2018-01-07 23:47:08 +01:00
parent 92cc1f354b
commit 1eb256bd4e
No known key found for this signature in database
GPG key ID: 7A0B673A2D4BF257
2 changed files with 9 additions and 4 deletions

View file

@ -542,14 +542,17 @@ void EmoteManager::loadFFZEmotes()
// emoteName is used for giving a name to the emote in case it doesn't exist // emoteName is used for giving a name to the emote in case it doesn't exist
util::EmoteData EmoteManager::getTwitchEmoteById(long id, const QString &emoteName) util::EmoteData EmoteManager::getTwitchEmoteById(long id, const QString &emoteName)
{ {
return _twitchEmoteFromCache.getOrAdd(id, [this, &emoteName, &id] { QString _emoteName = emoteName;
_emoteName.replace("<", "&lt;");
return _twitchEmoteFromCache.getOrAdd(id, [this, &emoteName, &_emoteName, &id] {
util::EmoteData newEmoteData; util::EmoteData newEmoteData;
newEmoteData.image1x = new LazyLoadedImage(GetTwitchEmoteLink(id, "1.0"), 1, emoteName, newEmoteData.image1x = new LazyLoadedImage(GetTwitchEmoteLink(id, "1.0"), 1, emoteName,
emoteName + "<br/>Twitch Emote 1x"); _emoteName + "<br/>Twitch Emote 1x");
newEmoteData.image2x = new LazyLoadedImage(GetTwitchEmoteLink(id, "2.0"), .5, emoteName, newEmoteData.image2x = new LazyLoadedImage(GetTwitchEmoteLink(id, "2.0"), .5, emoteName,
emoteName + "<br/>Twitch Emote 2x"); _emoteName + "<br/>Twitch Emote 2x");
newEmoteData.image3x = new LazyLoadedImage(GetTwitchEmoteLink(id, "3.0"), .25, emoteName, newEmoteData.image3x = new LazyLoadedImage(GetTwitchEmoteLink(id, "3.0"), .25, emoteName,
emoteName + "<br/>Twitch Emote 3x"); _emoteName + "<br/>Twitch Emote 3x");
return newEmoteData; return newEmoteData;
}); });

View file

@ -19,6 +19,7 @@ TooltipWidget::TooltipWidget(BaseWidget *parent)
palette.setColor(QPalette::WindowText, white); palette.setColor(QPalette::WindowText, white);
palette.setColor(QPalette::Background, black); palette.setColor(QPalette::Background, black);
this->setPalette(palette); this->setPalette(palette);
this->displayText->setStyleSheet("color: #ffffff");
this->setWindowOpacity(0.8); this->setWindowOpacity(0.8);
this->setFont(singletons::FontManager::getInstance().getFont(singletons::FontManager::Type::MediumSmall, this->setFont(singletons::FontManager::getInstance().getFont(singletons::FontManager::Type::MediumSmall,
this->getDpiMultiplier())); this->getDpiMultiplier()));
@ -27,6 +28,7 @@ TooltipWidget::TooltipWidget(BaseWidget *parent)
this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
displayText->setAlignment(Qt::AlignHCenter); displayText->setAlignment(Qt::AlignHCenter);
displayText->setText("lmao xD");
auto layout = new QVBoxLayout(); auto layout = new QVBoxLayout();
layout->setContentsMargins(10, 5, 10, 5); layout->setContentsMargins(10, 5, 10, 5);
layout->addWidget(displayText); layout->addWidget(displayText);