From a8a07426b90b15b33806a815b6afec29f7e50db7 Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Tue, 29 Jun 2021 22:32:07 +0200 Subject: [PATCH] Only restrict Highlight color for whispers in messages tab (#2937) This fixes a bug, where changing color of the second row in Users tab in Highlights settings page was not possible. --- src/widgets/settingspages/HighlightingPage.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/widgets/settingspages/HighlightingPage.cpp b/src/widgets/settingspages/HighlightingPage.cpp index 20a8c4a73..d8aa170ca 100644 --- a/src/widgets/settingspages/HighlightingPage.cpp +++ b/src/widgets/settingspages/HighlightingPage.cpp @@ -349,12 +349,14 @@ void HighlightingPage::tableCellClicked(const QModelIndex &clicked, case HighlightTab::Messages: case HighlightTab::Users: { using Column = HighlightModel::Column; + bool restrictColorRow = + (tab == HighlightTab::Messages && + clicked.row() == HighlightModel::WHISPER_ROW); if (clicked.column() == Column::SoundPath) { this->openSoundDialog(clicked, view, Column::SoundPath); } - else if (clicked.column() == Column::Color && - clicked.row() != HighlightModel::WHISPER_ROW) + else if (clicked.column() == Column::Color && !restrictColorRow) { this->openColorDialog(clicked, view, tab); }