Add support for non-highlight channel point rewards (#1809)

This commit is contained in:
Jonas Schmitt
2020-08-08 15:37:22 +02:00
committed by GitHub
parent 1bd3d10eef
commit 11b8948290
23 changed files with 498 additions and 25 deletions
+9 -1
View File
@@ -169,7 +169,7 @@ void MessageLayout::actuallyLayout(int width, MessageElementFlags flags)
// Painting
void MessageLayout::paint(QPainter &painter, int width, int y, int messageIndex,
Selection &selection, bool isLastReadMessage,
bool isWindowFocused)
bool isWindowFocused, bool isMentions)
{
auto app = getApp();
QPixmap *pixmap = this->buffer_.get();
@@ -220,6 +220,14 @@ void MessageLayout::paint(QPainter &painter, int width, int y, int messageIndex,
app->themes->messages.disabled);
}
if (!isMentions &&
this->message_->flags.has(MessageFlag::RedeemedChannelPointReward))
{
painter.fillRect(
0, y, this->scale_ * 4, pixmap->height(),
*ColorProvider::instance().color(ColorType::Subscription));
}
// draw selection
if (!selection.isEmpty())
{