Fixed tabs not highlighting on new messages/highlights
This commit is contained in:
@@ -359,8 +359,12 @@ void ChannelView::setChannel(ChannelPtr newChannel)
|
||||
}
|
||||
}
|
||||
|
||||
if (message->flags & ~Message::DoNotTriggerNotification) {
|
||||
this->highlightedMessageReceived.invoke();
|
||||
if (!(message->flags & Message::DoNotTriggerNotification)) {
|
||||
if (message->flags & Message::Highlighted) {
|
||||
this->tabHighlightRequested.invoke(HighlightState::Highlighted);
|
||||
} else {
|
||||
this->tabHighlightRequested.invoke(HighlightState::NewMessage);
|
||||
}
|
||||
}
|
||||
|
||||
this->scrollBar.addHighlight(message->getScrollBarHighlight());
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
|
||||
pajlada::Signals::Signal<QMouseEvent *> mouseDown;
|
||||
pajlada::Signals::NoArgSignal selectionChanged;
|
||||
pajlada::Signals::NoArgSignal highlightedMessageReceived;
|
||||
pajlada::Signals::Signal<HighlightState> tabHighlightRequested;
|
||||
pajlada::Signals::Signal<const messages::Link &> linkClicked;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -19,8 +19,6 @@ class Notebook : public BaseWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum HighlightType { none, highlighted, newMessage };
|
||||
|
||||
explicit Notebook(Window *parent, bool _showButtons);
|
||||
|
||||
SplitContainer *addNewPage(bool select = false);
|
||||
|
||||
@@ -66,6 +66,8 @@ int SplitContainer::splitCount() const
|
||||
|
||||
std::pair<int, int> SplitContainer::removeFromLayout(Split *widget)
|
||||
{
|
||||
widget->getChannelView().tabHighlightRequested.disconnectAll();
|
||||
|
||||
// remove reference to chat widget from chatWidgets vector
|
||||
auto it = std::find(std::begin(this->splits), std::end(this->splits), widget);
|
||||
if (it != std::end(this->splits)) {
|
||||
@@ -150,6 +152,8 @@ std::pair<int, int> SplitContainer::removeFromLayout(Split *widget)
|
||||
void SplitContainer::addToLayout(Split *widget, std::pair<int, int> position)
|
||||
{
|
||||
this->splits.push_back(widget);
|
||||
widget->getChannelView().tabHighlightRequested.connect(
|
||||
[this](HighlightState state) { this->tab->setHighlightState(state); });
|
||||
|
||||
this->refreshTitle();
|
||||
|
||||
@@ -506,11 +510,6 @@ Split *SplitContainer::createChatWidget()
|
||||
{
|
||||
auto split = new Split(this);
|
||||
|
||||
split->getChannelView().highlightedMessageReceived.connect([this] {
|
||||
// fourtf: error potentionally here
|
||||
this->tab->setHighlightState(HighlightState::Highlighted); //
|
||||
});
|
||||
|
||||
return split;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user