diff --git a/src/controllers/highlights/HighlightPhrase.cpp b/src/controllers/highlights/HighlightPhrase.cpp index 7afd1a33b..f716fd7a6 100644 --- a/src/controllers/highlights/HighlightPhrase.cpp +++ b/src/controllers/highlights/HighlightPhrase.cpp @@ -9,6 +9,8 @@ namespace { } // namespace +// change made but removed in merge conflict +// QColor HighlightPhrase::FALLBACK_HIGHLIGHT_COLOR = QColor(238, 97, 102, 65); QColor HighlightPhrase::FALLBACK_HIGHLIGHT_COLOR = QColor(127, 63, 73, 127); QColor HighlightPhrase::FALLBACK_SELF_MESSAGE_HIGHLIGHT_COLOR = QColor(0, 118, 221, 115); diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index 066085030..eabeb64d3 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -1190,11 +1190,13 @@ void ChannelView::messageAppended(MessagePtr &message, (this->channel_->getType() == Channel::Type::TwitchAutomod && getSettings()->enableAutomodHighlight)) { - this->tabHighlightRequested.invoke(HighlightState::Highlighted); + this->tabHighlightRequested.invoke(HighlightState::Highlighted, + message->highlightColor); } else { - this->tabHighlightRequested.invoke(HighlightState::NewMessage); + this->tabHighlightRequested.invoke(HighlightState::NewMessage, + nullptr); } } diff --git a/src/widgets/helper/ChannelView.hpp b/src/widgets/helper/ChannelView.hpp index 704210712..ef0227fbe 100644 --- a/src/widgets/helper/ChannelView.hpp +++ b/src/widgets/helper/ChannelView.hpp @@ -11,6 +11,7 @@ #include "widgets/TooltipWidget.hpp" #include +#include #include #include #include @@ -21,6 +22,7 @@ #include #include +#include #include #include @@ -214,7 +216,8 @@ 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 be2b371a3..0ceaeecae 100644 --- a/src/widgets/helper/NotebookTab.cpp +++ b/src/widgets/helper/NotebookTab.cpp @@ -307,6 +307,7 @@ void NotebookTab::setSelected(bool value) this->selected_ = value; this->highlightState_ = HighlightState::None; + this->highlightColor_ = nullptr; this->update(); } @@ -397,6 +398,15 @@ bool NotebookTab::hasHighlightsEnabled() const return this->highlightEnabled_; } +void NotebookTab::setHighlightColor(std::shared_ptr color) +{ + if (this->highlightColor_ != color) + { + this->highlightColor_ = color; + this->update(); + } +} + QRect NotebookTab::getDesiredRect() const { return QRect(this->positionAnimationDesiredPoint_, size()); @@ -499,6 +509,14 @@ void NotebookTab::paintEvent(QPaintEvent *) : (windowFocused ? colors.line.regular : colors.line.unfocused); + if (this->highlightState_ == HighlightState::Highlighted && + this->highlightColor_ != nullptr) + { + QColor col = *this->highlightColor_; + col.setAlpha(255); + lineColor = col; + } + QRect lineRect; switch (this->tabLocation_) { diff --git a/src/widgets/helper/NotebookTab.hpp b/src/widgets/helper/NotebookTab.hpp index 6ae7802d0..842514bd5 100644 --- a/src/widgets/helper/NotebookTab.hpp +++ b/src/widgets/helper/NotebookTab.hpp @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -64,6 +65,7 @@ public: void setHighlightsEnabled(const bool &newVal); bool hasHighlightsEnabled() const; + void setHighlightColor(std::shared_ptr color); void moveAnimated(QPoint targetPos, bool animated = true); @@ -127,6 +129,7 @@ private: HighlightState highlightState_ = HighlightState::None; bool highlightEnabled_ = true; QAction *highlightNewMessagesAction_; + std::shared_ptr highlightColor_; bool isLive_{}; bool isRerun_{}; diff --git a/src/widgets/splits/SplitContainer.cpp b/src/widgets/splits/SplitContainer.cpp index 1cca478f0..c171e43b0 100644 --- a/src/widgets/splits/SplitContainer.cpp +++ b/src/widgets/splits/SplitContainer.cpp @@ -213,13 +213,19 @@ void SplitContainer::addSplit(Split *split) auto &&conns = this->connectionsPerSplit_[split]; - conns.managedConnect(split->getChannelView().tabHighlightRequested, - [this](HighlightState state) { - if (this->tab_ != nullptr) - { - this->tab_->setHighlightState(state); - } - }); + conns.managedConnect( + split->getChannelView().tabHighlightRequested, + [this](HighlightState state, std::shared_ptr color) { + if (this->tab_ != nullptr) + { + this->tab_->setHighlightState(state); + + if (color != nullptr) + { + this->tab_->setHighlightColor(color); + } + } + }); conns.managedConnect(split->getChannelView().liveStatusChanged, [this]() { this->refreshTabLiveStatus();