diff --git a/CHANGELOG.md b/CHANGELOG.md index f953b82e..1339c731 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unversioned + +- Bugfix: Fix bug preventing users from setting the highlight color of the second entry in the "User" highlights tab (#1898) + ## 2.2.0 - Major: We now support image thumbnails coming from the link resolver. This feature is off by default and can be enabled in the settings with the "Show link thumbnail" setting. This feature also requires the "Show link info when hovering" setting to be enabled (#1664) diff --git a/src/widgets/settingspages/HighlightingPage.cpp b/src/widgets/settingspages/HighlightingPage.cpp index f6076d6b..f1364de7 100644 --- a/src/widgets/settingspages/HighlightingPage.cpp +++ b/src/widgets/settingspages/HighlightingPage.cpp @@ -227,9 +227,15 @@ void HighlightingPage::tableCellClicked(const QModelIndex &clicked, Qt::CheckStateRole); } } - else if (clicked.column() == Column::Color && - clicked.row() != HighlightModel::WHISPER_ROW) + else if (clicked.column() == Column::Color) { + // Hacky (?) way to figure out what tab the cell was clicked in + const bool fromMessagesTab = + (dynamic_cast(view->getModel()) != nullptr); + + if (fromMessagesTab && clicked.row() == HighlightModel::WHISPER_ROW) + return; + auto initial = view->getModel()->data(clicked, Qt::DecorationRole).value(); @@ -244,11 +250,7 @@ void HighlightingPage::tableCellClicked(const QModelIndex &clicked, view->getModel()->setData(clicked, selected, Qt::DecorationRole); - // Hacky (?) way to figure out what tab the cell was clicked in - const bool fromMessages = (dynamic_cast( - view->getModel()) != nullptr); - - if (fromMessages) + if (fromMessagesTab) { /* * For preset highlights in the "Messages" tab, we need to