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
@@ -259,6 +259,24 @@ void HighlightModel::afterInit()
setColorItem(automodRow[Column::Color], *automodColor, false);
this->insertCustomRow(automodRow, HighlightRowIndexes::AutomodRow);
std::vector<QStandardItem *> watchStreakRow = this->createRow();
setBoolItem(watchStreakRow[Column::Pattern],
getSettings()->enableWatchStreakHighlight.getValue(), true,
false);
watchStreakRow[Column::Pattern]->setData("Watch Streaks", Qt::DisplayRole);
watchStreakRow[Column::ShowInMentions]->setFlags({});
watchStreakRow[Column::FlashTaskbar]->setFlags({});
watchStreakRow[Column::PlaySound]->setFlags({});
watchStreakRow[Column::UseRegex]->setFlags({});
watchStreakRow[Column::CaseSensitive]->setFlags({});
watchStreakRow[Column::SoundPath]->setFlags(Qt::NoItemFlags);
auto watchStreakColor =
ColorProvider::instance().color(ColorType::WatchStreak);
setColorItem(watchStreakRow[Column::Color], *watchStreakColor, false);
this->insertCustomRow(watchStreakRow, HighlightRowIndexes::WatchStreakRow);
}
void HighlightModel::customRowSetData(const std::vector<QStandardItem *> &row,
@@ -283,6 +301,11 @@ void HighlightModel::customRowSetData(const std::vector<QStandardItem *> &row,
{
getSettings()->enableSubHighlight.setValue(value.toBool());
}
else if (rowIndex == HighlightRowIndexes::WatchStreakRow)
{
getSettings()->enableWatchStreakHighlight.setValue(
value.toBool());
}
else if (rowIndex == HighlightRowIndexes::RedeemedRow)
{
getSettings()->enableRedeemedHighlight.setValue(
@@ -489,6 +512,11 @@ void HighlightModel::customRowSetData(const std::vector<QStandardItem *> &row,
setColor(getSettings()->subHighlightColor,
ColorType::Subscription);
}
else if (rowIndex == HighlightRowIndexes::WatchStreakRow)
{
setColor(getSettings()->watchStreakHighlightColor,
ColorType::WatchStreak);
}
else if (rowIndex == HighlightRowIndexes::RedeemedRow)
{
setColor(getSettings()->redeemedHighlightColor,
@@ -35,6 +35,7 @@ public:
ElevatedMessageRow = 5,
ThreadMessageRow = 6,
AutomodRow = 7,
WatchStreakRow = 8,
};
enum UserHighlightRowIndexes {
@@ -24,6 +24,7 @@ QColor HighlightPhrase::FALLBACK_THREAD_HIGHLIGHT_COLOR =
QColor(143, 48, 24, 60);
QColor HighlightPhrase::FALLBACK_SUB_COLOR = QColor(196, 102, 255, 100);
QColor HighlightPhrase::FALLBACK_AUTOMOD_HIGHLIGHT_COLOR = QColor(64, 64, 64);
QColor HighlightPhrase::FALLBACK_WATCH_STREAK_COLOR = QColor(0, 130, 255, 70);
bool HighlightPhrase::operator==(const HighlightPhrase &other) const
{
@@ -83,6 +83,7 @@ public:
static QColor FALLBACK_SELF_MESSAGE_HIGHLIGHT_COLOR;
static QColor FALLBACK_REDEEMED_HIGHLIGHT_COLOR;
static QColor FALLBACK_SUB_COLOR;
static QColor FALLBACK_WATCH_STREAK_COLOR;
static QColor FALLBACK_FIRST_MESSAGE_HIGHLIGHT_COLOR;
static QColor FALLBACK_ELEVATED_MESSAGE_HIGHLIGHT_COLOR;
static QColor FALLBACK_THREAD_HIGHLIGHT_COLOR;