Add highlight color and show in mentions to automod messages (#5215)

This commit is contained in:
KleberPF
2024-03-09 08:03:36 -03:00
committed by GitHub
parent ecad4b052a
commit c50791972d
13 changed files with 69 additions and 10 deletions
+15 -3
View File
@@ -238,9 +238,10 @@ void HighlightModel::afterInit()
const std::vector<QStandardItem *> automodRow = this->createRow();
setBoolItem(automodRow[Column::Pattern],
getSettings()->enableAutomodHighlight.getValue(), true, false);
setBoolItem(automodRow[Column::ShowInMentions],
getSettings()->showAutomodInMentions.getValue(), true, false);
automodRow[Column::Pattern]->setData("AutoMod Caught Messages",
Qt::DisplayRole);
automodRow[Column::ShowInMentions]->setFlags({});
setBoolItem(automodRow[Column::FlashTaskbar],
getSettings()->enableAutomodHighlightTaskbar.getValue(), true,
false);
@@ -253,8 +254,9 @@ void HighlightModel::afterInit()
const auto automodSound =
QUrl(getSettings()->automodHighlightSoundUrl.getValue());
setFilePathItem(automodRow[Column::SoundPath], automodSound, false);
automodRow[Column::Color]->setFlags(Qt::ItemFlag::NoItemFlags);
auto automodColor =
ColorProvider::instance().color(ColorType::AutomodHighlight);
setColorItem(automodRow[Column::Color], *automodColor, false);
this->insertCustomRow(automodRow, HighlightRowIndexes::AutomodRow);
}
@@ -322,6 +324,11 @@ void HighlightModel::customRowSetData(const std::vector<QStandardItem *> &row,
getSettings()->showThreadHighlightInMentions.setValue(
value.toBool());
}
else if (rowIndex == HighlightRowIndexes::AutomodRow)
{
getSettings()->showAutomodInMentions.setValue(
value.toBool());
}
}
}
break;
@@ -502,6 +509,11 @@ void HighlightModel::customRowSetData(const std::vector<QStandardItem *> &row,
setColor(getSettings()->threadHighlightColor,
ColorType::ThreadMessageHighlight);
}
else if (rowIndex == HighlightRowIndexes::AutomodRow)
{
setColor(getSettings()->automodHighlightColor,
ColorType::AutomodHighlight);
}
}
}
break;