mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fix styling of channel point reward message text. (#1845)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
parent
73f7786522
commit
58725efbd5
|
@ -42,6 +42,7 @@ enum class MessageElementFlag {
|
|||
BttvEmote = BttvEmoteImage | BttvEmoteText,
|
||||
|
||||
ChannelPointReward = (1 << 8),
|
||||
ChannelPointRewardImage = ChannelPointReward | TwitchEmoteImage,
|
||||
|
||||
FfzEmoteImage = (1 << 10),
|
||||
FfzEmoteText = (1 << 11),
|
||||
|
|
|
@ -123,9 +123,20 @@ void MessageLayoutContainer::_addElement(MessageLayoutElement *element,
|
|||
xOffset -= element->getRect().width() + this->spaceWidth_;
|
||||
}
|
||||
|
||||
auto yOffset = 0;
|
||||
|
||||
if (element->getCreator().getFlags().has(
|
||||
MessageElementFlag::ChannelPointReward) &&
|
||||
element->getCreator().getFlags().hasNone(
|
||||
{MessageElementFlag::TwitchEmoteImage}))
|
||||
{
|
||||
yOffset -= (this->margin.top * this->scale_);
|
||||
}
|
||||
|
||||
// set move element
|
||||
element->setPosition(QPoint(this->currentX_ + xOffset,
|
||||
this->currentY_ - element->getRect().height()));
|
||||
element->setPosition(
|
||||
QPoint(this->currentX_ + xOffset,
|
||||
this->currentY_ - element->getRect().height() + yOffset));
|
||||
|
||||
// add element
|
||||
this->elements_.push_back(std::unique_ptr<MessageLayoutElement>(element));
|
||||
|
|
|
@ -1158,7 +1158,7 @@ void TwitchMessageBuilder::appendChannelPointRewardMessage(
|
|||
reward.title, MessageElementFlag::ChannelPointReward,
|
||||
MessageColor::Text, FontStyle::ChatMediumBold);
|
||||
builder->emplace<ScalingImageElement>(
|
||||
reward.image, MessageElementFlag::ChannelPointReward);
|
||||
reward.image, MessageElementFlag::ChannelPointRewardImage);
|
||||
builder->emplace<TextElement>(
|
||||
QString::number(reward.cost), MessageElementFlag::ChannelPointReward,
|
||||
MessageColor::Text, FontStyle::ChatMediumBold);
|
||||
|
|
Loading…
Reference in a new issue