refined highlight and added bits highlights

This commit is contained in:
fourtf
2020-04-15 23:15:45 +02:00
parent ebfcb49e8c
commit 097f4ccb3a
16 changed files with 164 additions and 22 deletions
+6
View File
@@ -35,6 +35,12 @@ SBHighlight Message::getScrollBarHighlight() const
return SBHighlight(
ColorProvider::instance().color(ColorType::Subscription));
}
else if (this->flags.has(MessageFlag::RedeemedHighlight))
{
return SBHighlight(
ColorProvider::instance().color(ColorType::RedeemedHighlight),
SBHighlight::Default, true);
}
return SBHighlight();
}
+1
View File
@@ -34,6 +34,7 @@ enum class MessageFlag : uint32_t {
HighlightedWhisper = (1 << 17),
Debug = (1 << 18),
Similar = (1 << 19),
RedeemedHighlight = (1 << 20),
};
using MessageFlags = FlagsEnum<MessageFlag>;
+9
View File
@@ -263,6 +263,7 @@ void MessageLayout::updateBuffer(QPixmap *buffer, int /*messageIndex*/,
Selection & /*selection*/)
{
auto app = getApp();
auto settings = getSettings();
QPainter painter(buffer);
painter.setRenderHint(QPainter::SmoothPixmapTransform);
@@ -296,6 +297,14 @@ void MessageLayout::updateBuffer(QPixmap *buffer, int /*messageIndex*/,
backgroundColor,
*ColorProvider::instance().color(ColorType::Subscription));
}
else if (this->message_->flags.has(MessageFlag::RedeemedHighlight) &&
settings->enableRedeemedHighlight.getValue())
{
// Blend highlight color with usual background color
backgroundColor = blendColors(
backgroundColor,
*ColorProvider::instance().color(ColorType::RedeemedHighlight));
}
else if (this->message_->flags.has(MessageFlag::AutoMod))
{
backgroundColor = QColor("#404040");