feat: seperate watchstreak highlights from sub highlights (#6571)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -39,6 +39,14 @@ ScrollbarHighlight Message::getScrollBarHighlight() const
|
||||
};
|
||||
}
|
||||
|
||||
if (this->flags.has(MessageFlag::WatchStreak) &&
|
||||
getSettings()->enableWatchStreakHighlight)
|
||||
{
|
||||
return {
|
||||
ColorProvider::instance().color(ColorType::WatchStreak),
|
||||
};
|
||||
}
|
||||
|
||||
if (this->flags.has(MessageFlag::Subscription) &&
|
||||
getSettings()->enableSubHighlight)
|
||||
{
|
||||
|
||||
@@ -72,6 +72,7 @@ enum class MessageFlag : std::int64_t {
|
||||
/// - message was deleted via chat clear user messages (IRC: CLEARCHAT(user), EVENTSUB: channel.chat.clear_user_messages)
|
||||
/// Note: If this message is inside a reply thread, the root must not have the flag either.
|
||||
InvalidReplyTarget = (1LL << 42),
|
||||
WatchStreak = (1LL << 43),
|
||||
};
|
||||
using MessageFlags = FlagsEnum<MessageFlag>;
|
||||
|
||||
|
||||
@@ -396,6 +396,12 @@ void MessageLayout::updateBuffer(QPixmap *buffer,
|
||||
backgroundColor,
|
||||
*ctx.colorProvider.color(ColorType::FirstMessageHighlight));
|
||||
}
|
||||
else if (this->message_->flags.has(MessageFlag::WatchStreak) &&
|
||||
ctx.preferences.enableWatchStreakHighlight)
|
||||
{
|
||||
backgroundColor = blendColors(
|
||||
backgroundColor, *ctx.colorProvider.color(ColorType::WatchStreak));
|
||||
}
|
||||
else if ((this->message_->flags.has(MessageFlag::Highlighted) ||
|
||||
this->message_->flags.has(MessageFlag::HighlightedWhisper)) &&
|
||||
!this->flags.has(MessageLayoutFlag::IgnoreHighlights))
|
||||
|
||||
@@ -70,6 +70,12 @@ void MessagePreferences::connectSettings(Settings *settings,
|
||||
},
|
||||
holder);
|
||||
|
||||
settings->enableWatchStreakHighlight.connect(
|
||||
[this](const auto &newValue) {
|
||||
this->enableWatchStreakHighlight = newValue;
|
||||
},
|
||||
holder);
|
||||
|
||||
settings->enableAutomodHighlight.connect(
|
||||
[this](const auto &newValue) {
|
||||
this->enableAutomodHighlight = newValue;
|
||||
|
||||
@@ -50,6 +50,7 @@ struct MessagePreferences {
|
||||
bool enableElevatedMessageHighlight{};
|
||||
bool enableFirstMessageHighlight{};
|
||||
bool enableSubHighlight{};
|
||||
bool enableWatchStreakHighlight{};
|
||||
bool enableAutomodHighlight{};
|
||||
|
||||
bool alternateMessages{};
|
||||
|
||||
Reference in New Issue
Block a user