feat: seperate watchstreak highlights from sub highlights (#6571)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user