feat: seperate watchstreak highlights from sub highlights (#6571)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
dp
2025-11-16 15:12:43 +01:00
committed by GitHub
parent 8a58fcf0df
commit db060d5b5a
15 changed files with 94 additions and 6 deletions
+8
View File
@@ -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)
{
+1
View File
@@ -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>;
+6
View File
@@ -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{};