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,10 +378,12 @@ void ChannelView::setChannel(SharedChannel newChannel)
|
||||||
auto messageRef = new MessageLayout(message);
|
auto messageRef = new MessageLayout(message);
|
||||||
|
|
||||||
if (this->messages.pushBack(MessageLayoutPtr(messageRef), deleted)) {
|
if (this->messages.pushBack(MessageLayoutPtr(messageRef), deleted)) {
|
||||||
if (this->scrollBar.isAtBottom()) {
|
if (!this->paused) {
|
||||||
this->scrollBar.scrollToBottom();
|
if (this->scrollBar.isAtBottom()) {
|
||||||
} else {
|
this->scrollBar.scrollToBottom();
|
||||||
this->scrollBar.offset(-1);
|
} else {
|
||||||
|
this->scrollBar.offset(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,11 +406,13 @@ void ChannelView::setChannel(SharedChannel newChannel)
|
||||||
messageRefs.at(i) = MessageLayoutPtr(new MessageLayout(messages.at(i)));
|
messageRefs.at(i) = MessageLayoutPtr(new MessageLayout(messages.at(i)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->messages.pushFront(messageRefs).size() > 0) {
|
if (!this->paused) {
|
||||||
if (this->scrollBar.isAtBottom()) {
|
if (this->messages.pushFront(messageRefs).size() > 0) {
|
||||||
this->scrollBar.scrollToBottom();
|
if (this->scrollBar.isAtBottom()) {
|
||||||
} else {
|
this->scrollBar.scrollToBottom();
|
||||||
this->scrollBar.offset((qreal)messages.size());
|
} else {
|
||||||
|
this->scrollBar.offset((qreal)messages.size());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue