Remove tabHighlightColorRequested signal

Moved the functionality to tabHighlightRequested instead of having two
signals that modify similar things
This commit is contained in:
tuckerrrrrrrrrrrr 2020-03-14 09:40:23 -07:00
parent e9bebfe788
commit 2a9b8e15c4
3 changed files with 9 additions and 14 deletions

View file

@ -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);
}
}

View file

@ -85,9 +85,8 @@ public:
pajlada::Signals::Signal<QMouseEvent *> mouseDown;
pajlada::Signals::NoArgSignal selectionChanged;
pajlada::Signals::Signal<HighlightState> tabHighlightRequested;
pajlada::Signals::Signal<std::shared_ptr<QColor>>
tabHighlightColorRequested;
pajlada::Signals::Signal<HighlightState, std::shared_ptr<QColor>>
tabHighlightRequested;
pajlada::Signals::NoArgSignal liveStatusChanged;
pajlada::Signals::Signal<const Link &> linkClicked;
pajlada::Signals::Signal<QString> joinToChannel;

View file

@ -200,17 +200,15 @@ void SplitContainer::addSplit(Split *split)
this->refreshTab();
split->getChannelView().tabHighlightRequested.connect(
[this](HighlightState state) {
[this](HighlightState state, std::shared_ptr<QColor> color) {
if (this->tab_ != nullptr)
{
this->tab_->setHighlightState(state);
}
});
split->getChannelView().tabHighlightColorRequested.connect(
[this](std::shared_ptr<QColor> 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;
}