mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fixes #221
This commit is contained in:
parent
a7fa4160e8
commit
a339c4ca0a
|
@ -378,12 +378,14 @@ void ChannelView::setChannel(SharedChannel newChannel)
|
|||
auto messageRef = new MessageLayout(message);
|
||||
|
||||
if (this->messages.pushBack(MessageLayoutPtr(messageRef), deleted)) {
|
||||
if (!this->paused) {
|
||||
if (this->scrollBar.isAtBottom()) {
|
||||
this->scrollBar.scrollToBottom();
|
||||
} else {
|
||||
this->scrollBar.offset(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!message->hasFlags(Message::DoNotTriggerNotification)) {
|
||||
this->highlightedMessageReceived.invoke();
|
||||
|
@ -404,6 +406,7 @@ void ChannelView::setChannel(SharedChannel newChannel)
|
|||
messageRefs.at(i) = MessageLayoutPtr(new MessageLayout(messages.at(i)));
|
||||
}
|
||||
|
||||
if (!this->paused) {
|
||||
if (this->messages.pushFront(messageRefs).size() > 0) {
|
||||
if (this->scrollBar.isAtBottom()) {
|
||||
this->scrollBar.scrollToBottom();
|
||||
|
@ -411,6 +414,7 @@ void ChannelView::setChannel(SharedChannel newChannel)
|
|||
this->scrollBar.offset((qreal)messages.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<ScrollbarHighlight> highlights;
|
||||
highlights.reserve(messages.size());
|
||||
|
|
Loading…
Reference in a new issue