From 0e506fc1757dde8c553b296d3689fcb44119e4d4 Mon Sep 17 00:00:00 2001 From: unknown <1310440+hemirt@users.noreply.github.com> Date: Mon, 28 Oct 2024 13:41:16 +0100 Subject: [PATCH] remove remnants of different strategy --- src/widgets/helper/ChannelView.cpp | 6 ++---- src/widgets/helper/ChannelView.hpp | 3 +-- src/widgets/helper/NotebookTab.cpp | 13 +++++-------- src/widgets/helper/NotebookTab.hpp | 6 ++---- src/widgets/splits/SplitContainer.cpp | 17 ++++++++--------- 5 files changed, 18 insertions(+), 27 deletions(-) diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index eb33cef3b..c63ba474b 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -1194,13 +1194,11 @@ void ChannelView::messageAppended(MessagePtr &message, (this->channel_->getType() == Channel::Type::TwitchAutomod && getSettings()->enableAutomodHighlight)) { - this->tabHighlightRequested.invoke(HighlightState::Highlighted, - message); + this->tabHighlightRequested.invoke(HighlightState::Highlighted); } else { - this->tabHighlightRequested.invoke(HighlightState::NewMessage, - message); + this->tabHighlightRequested.invoke(HighlightState::NewMessage); } } diff --git a/src/widgets/helper/ChannelView.hpp b/src/widgets/helper/ChannelView.hpp index 7c91d7234..a39efe4e8 100644 --- a/src/widgets/helper/ChannelView.hpp +++ b/src/widgets/helper/ChannelView.hpp @@ -225,8 +225,7 @@ public: pajlada::Signals::Signal mouseDown; pajlada::Signals::NoArgSignal selectionChanged; - pajlada::Signals::Signal - tabHighlightRequested; + pajlada::Signals::Signal tabHighlightRequested; pajlada::Signals::NoArgSignal liveStatusChanged; pajlada::Signals::Signal linkClicked; pajlada::Signals::Signal diff --git a/src/widgets/helper/NotebookTab.cpp b/src/widgets/helper/NotebookTab.cpp index 09630c7e0..563084d39 100644 --- a/src/widgets/helper/NotebookTab.cpp +++ b/src/widgets/helper/NotebookTab.cpp @@ -518,8 +518,7 @@ void NotebookTab::setHighlightState(HighlightState newHighlightStyle) } void NotebookTab::updateHighlightState(HighlightState newHighlightStyle, - const ChannelView &channelViewSource, - const MessagePtr &message) + const ChannelView &channelViewSource) { if (this->isSelected()) { @@ -528,7 +527,7 @@ void NotebookTab::updateHighlightState(HighlightState newHighlightStyle, return; } - if (!this->shouldMessageHighlight(channelViewSource, message)) + if (!this->shouldMessageHighlight(channelViewSource)) { return; } @@ -572,8 +571,8 @@ void NotebookTab::updateHighlightState(HighlightState newHighlightStyle, this->update(); } -bool NotebookTab::shouldMessageHighlight(const ChannelView &channelViewSource, - const MessagePtr &message) const +bool NotebookTab::shouldMessageHighlight( + const ChannelView &channelViewSource) const { auto *visibleSplitContainer = dynamic_cast(this->notebook_->getSelectedPage()); @@ -583,9 +582,7 @@ bool NotebookTab::shouldMessageHighlight(const ChannelView &channelViewSource, for (const auto &visibleSplit : visibleSplits) { if (channelViewSource.getID() == - visibleSplit->getChannelView().getID() && - visibleSplit->getChannelView().shouldIncludeMessage(message) && - channelViewSource.shouldIncludeMessage(message)) + visibleSplit->getChannelView().getID()) { return false; } diff --git a/src/widgets/helper/NotebookTab.hpp b/src/widgets/helper/NotebookTab.hpp index e210d4829..ae3bfbc2f 100644 --- a/src/widgets/helper/NotebookTab.hpp +++ b/src/widgets/helper/NotebookTab.hpp @@ -72,8 +72,7 @@ public: * Obeys the HighlightsEnabled setting and the highlight state hierarchy and tracks the highlight state update sources */ void updateHighlightState(HighlightState style, - const ChannelView &channelViewSource, - const MessagePtr &message); + const ChannelView &channelViewSource); void copyHighlightStateAndSourcesFrom(const NotebookTab *sourceTab); void setHighlightsEnabled(const bool &newVal); void newHighlightSourceAdded(const ChannelView &channelViewSource); @@ -122,8 +121,7 @@ private: int normalTabWidthForHeight(int height) const; - bool shouldMessageHighlight(const ChannelView &channelViewSource, - const MessagePtr &message) const; + bool shouldMessageHighlight(const ChannelView &channelViewSource) const; using HighlightSources = std::unordered_map; diff --git a/src/widgets/splits/SplitContainer.cpp b/src/widgets/splits/SplitContainer.cpp index e0ef7d4ea..430098f0e 100644 --- a/src/widgets/splits/SplitContainer.cpp +++ b/src/widgets/splits/SplitContainer.cpp @@ -213,15 +213,14 @@ void SplitContainer::addSplit(Split *split) auto &&conns = this->connectionsPerSplit_[split]; - conns.managedConnect( - split->getChannelView().tabHighlightRequested, - [this, split](HighlightState state, const MessagePtr &message) { - if (this->tab_ != nullptr) - { - this->tab_->updateHighlightState(state, split->getChannelView(), - message); - } - }); + conns.managedConnect(split->getChannelView().tabHighlightRequested, + [this, split](HighlightState state) { + if (this->tab_ != nullptr) + { + this->tab_->updateHighlightState( + state, split->getChannelView()); + } + }); conns.managedConnect(split->channelChanged, [this, split] { if (this->tab_ != nullptr)