removed access to theme from TMB + misc fixes (#2694)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
fourtf
2021-06-20 15:55:35 +02:00
committed by GitHub
parent 0c2488505c
commit 1efc547aa5
6 changed files with 16 additions and 17 deletions
+5 -11
View File
@@ -117,7 +117,6 @@ TwitchMessageBuilder::TwitchMessageBuilder(
: SharedMessageBuilder(_channel, _ircMessage, _args)
, twitchChannel(dynamic_cast<TwitchChannel *>(_channel))
{
this->usernameColor_ = getApp()->themes->messages.textColors.system;
}
TwitchMessageBuilder::TwitchMessageBuilder(
@@ -126,7 +125,6 @@ TwitchMessageBuilder::TwitchMessageBuilder(
: SharedMessageBuilder(_channel, _ircMessage, _args, content, isAction)
, twitchChannel(dynamic_cast<TwitchChannel *>(_channel))
{
this->usernameColor_ = getApp()->themes->messages.textColors.system;
}
bool TwitchMessageBuilder::isIgnored() const
@@ -468,8 +466,7 @@ void TwitchMessageBuilder::addTextOrEmoji(const QString &string_)
// Actually just text
auto linkString = this->matchLink(string);
auto textColor = this->action_ ? MessageColor(this->usernameColor_)
: MessageColor(MessageColor::Text);
auto textColor = this->textColor_;
if (!linkString.isEmpty())
{
@@ -725,18 +722,15 @@ void TwitchMessageBuilder::appendUsername()
// Separator
this->emplace<TextElement>("->", MessageElementFlag::Username,
app->themes->messages.textColors.system,
FontStyle::ChatMedium);
MessageColor::System, FontStyle::ChatMedium);
QColor selfColor = currentUser->color();
if (!selfColor.isValid())
{
selfColor = app->themes->messages.textColors.system;
}
MessageColor selfMsgColor =
selfColor.isValid() ? selfColor : MessageColor::System;
// Your own username
this->emplace<TextElement>(currentUser->getUserName() + ":",
MessageElementFlag::Username, selfColor,
MessageElementFlag::Username, selfMsgColor,
FontStyle::ChatMediumBold);
}
else