Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom highlight color in tabs #1557

Closed
wants to merge 11 commits into from
8 changes: 4 additions & 4 deletions src/widgets/helper/ChannelView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/widgets/helper/ChannelView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ class ChannelView final : public BaseWidget

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;
Expand Down
10 changes: 3 additions & 7 deletions src/widgets/splits/SplitContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2qar marked this conversation as resolved.
Show resolved Hide resolved
});

split->getChannelView().liveStatusChanged.connect([this]() {
Expand Down Expand Up @@ -271,8 +269,6 @@ SplitContainer::Position SplitContainer::releaseSplit(Split *split)

split->getChannelView().tabHighlightRequested.disconnectAll();

split->getChannelView().tabHighlightColorRequested.disconnectAll();

return position;
}

Expand Down