From 2a9b8e15c4128395334a92e5a7954773368ae4b7 Mon Sep 17 00:00:00 2001 From: tuckerrrrrrrrrrrr Date: Sat, 14 Mar 2020 09:40:23 -0700 Subject: [PATCH] Remove tabHighlightColorRequested signal Moved the functionality to tabHighlightRequested instead of having two signals that modify similar things --- src/widgets/helper/ChannelView.cpp | 8 ++++---- src/widgets/helper/ChannelView.hpp | 5 ++--- src/widgets/splits/SplitContainer.cpp | 10 +++------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index 34d6cb8a9..95233084e 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -651,13 +651,13 @@ void ChannelView::messageAppended(MessagePtr &message, if (messageFlags->has(MessageFlag::Highlighted) && !messageFlags->has(MessageFlag::Subscription)) { - this->tabHighlightRequested.invoke(HighlightState::Highlighted); - this->tabHighlightColorRequested.invoke(message->highlightColor); + this->tabHighlightRequested.invoke(HighlightState::Highlighted, + message->highlightColor); } else { - this->tabHighlightRequested.invoke(HighlightState::NewMessage); - this->tabHighlightColorRequested.invoke(nullptr); + this->tabHighlightRequested.invoke(HighlightState::NewMessage, + nullptr); } } diff --git a/src/widgets/helper/ChannelView.hpp b/src/widgets/helper/ChannelView.hpp index 9f6bf64b5..70f9264cf 100644 --- a/src/widgets/helper/ChannelView.hpp +++ b/src/widgets/helper/ChannelView.hpp @@ -85,9 +85,8 @@ public: pajlada::Signals::Signal mouseDown; pajlada::Signals::NoArgSignal selectionChanged; - pajlada::Signals::Signal tabHighlightRequested; - pajlada::Signals::Signal> - tabHighlightColorRequested; + pajlada::Signals::Signal> + tabHighlightRequested; pajlada::Signals::NoArgSignal liveStatusChanged; pajlada::Signals::Signal linkClicked; pajlada::Signals::Signal joinToChannel; diff --git a/src/widgets/splits/SplitContainer.cpp b/src/widgets/splits/SplitContainer.cpp index c14143dcb..5cc218eac 100644 --- a/src/widgets/splits/SplitContainer.cpp +++ b/src/widgets/splits/SplitContainer.cpp @@ -200,17 +200,15 @@ void SplitContainer::addSplit(Split *split) this->refreshTab(); split->getChannelView().tabHighlightRequested.connect( - [this](HighlightState state) { + [this](HighlightState state, std::shared_ptr color) { if (this->tab_ != nullptr) { this->tab_->setHighlightState(state); } - }); - - split->getChannelView().tabHighlightColorRequested.connect( - [this](std::shared_ptr color) { if (color != nullptr) + { this->tab_->setHighlightColor(color); + } }); split->getChannelView().liveStatusChanged.connect([this]() { @@ -271,8 +269,6 @@ SplitContainer::Position SplitContainer::releaseSplit(Split *split) split->getChannelView().tabHighlightRequested.disconnectAll(); - split->getChannelView().tabHighlightColorRequested.disconnectAll(); - return position; }