diff --git a/src/widgets/helper/NotebookTab.cpp b/src/widgets/helper/NotebookTab.cpp index d1c0055cf..886366d5e 100644 --- a/src/widgets/helper/NotebookTab.cpp +++ b/src/widgets/helper/NotebookTab.cpp @@ -344,6 +344,9 @@ void NotebookTab::copyHighlightStateAndSourcesFrom(const NotebookTab *sourceTab) { if (this->isSelected()) { + assert(this->highlightSources_.highlightedSource.empty()); + assert(this->highlightSources_.newMessageSource.empty()); + assert(this->highlightState_ == HighlightState::None); return; } @@ -391,7 +394,6 @@ void NotebookTab::setSelected(bool value) } this->highlightSources_.clear(); - this->highlightState_ = HighlightState::None; this->update(); @@ -453,9 +455,14 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle) { if (this->isSelected()) { + assert(this->highlightSources_.highlightedSource.empty()); + assert(this->highlightSources_.newMessageSource.empty()); + assert(this->highlightState_ == HighlightState::None); return; } + this->highlightSources_.clear(); + if (!this->highlightEnabled_ && newHighlightStyle == HighlightState::NewMessage) { @@ -472,18 +479,15 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle) this->update(); } -void NotebookTab::forceHighlightState(HighlightState newHighlightStyle) -{ - this->highlightState_ = newHighlightStyle; - this->update(); -} - void NotebookTab::updateHighlightState(HighlightState newHighlightStyle, const ChannelView &channelViewSource, const MessagePtr &message) { if (this->isSelected()) { + assert(this->highlightSources_.highlightedSource.empty()); + assert(this->highlightSources_.newMessageSource.empty()); + assert(this->highlightState_ == HighlightState::None); return; } diff --git a/src/widgets/helper/NotebookTab.hpp b/src/widgets/helper/NotebookTab.hpp index cab7b0941..8be7f1e97 100644 --- a/src/widgets/helper/NotebookTab.hpp +++ b/src/widgets/helper/NotebookTab.hpp @@ -61,17 +61,11 @@ public: bool isLive() const; /** - * @brief Sets the highlight state of this tab clearing out highlight sources + * @brief Sets the highlight state of this tab clearing highlight sources * * Obeys the HighlightsEnabled setting and highlight states hierarchy */ void setHighlightState(HighlightState style); - /** - * @brief Forces the highlight state of this tab - * - * Does NOT obey the HighlightsEnabled setting and the highlight states hierarchy - */ - void forceHighlightState(HighlightState style); /** * @brief Updates the highlight state and highlight sources of this tab *