From a339c4ca0abbebb4bff542285876fcbd7cd8f65e Mon Sep 17 00:00:00 2001 From: fourtf Date: Thu, 11 Jan 2018 21:03:40 +0100 Subject: [PATCH] fixes #221 --- src/widgets/helper/channelview.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/widgets/helper/channelview.cpp b/src/widgets/helper/channelview.cpp index a218788f7..a12ced578 100644 --- a/src/widgets/helper/channelview.cpp +++ b/src/widgets/helper/channelview.cpp @@ -378,10 +378,12 @@ void ChannelView::setChannel(SharedChannel newChannel) auto messageRef = new MessageLayout(message); if (this->messages.pushBack(MessageLayoutPtr(messageRef), deleted)) { - if (this->scrollBar.isAtBottom()) { - this->scrollBar.scrollToBottom(); - } else { - this->scrollBar.offset(-1); + if (!this->paused) { + if (this->scrollBar.isAtBottom()) { + this->scrollBar.scrollToBottom(); + } else { + this->scrollBar.offset(-1); + } } } @@ -404,11 +406,13 @@ void ChannelView::setChannel(SharedChannel newChannel) messageRefs.at(i) = MessageLayoutPtr(new MessageLayout(messages.at(i))); } - if (this->messages.pushFront(messageRefs).size() > 0) { - if (this->scrollBar.isAtBottom()) { - this->scrollBar.scrollToBottom(); - } else { - this->scrollBar.offset((qreal)messages.size()); + if (!this->paused) { + if (this->messages.pushFront(messageRefs).size() > 0) { + if (this->scrollBar.isAtBottom()) { + this->scrollBar.scrollToBottom(); + } else { + this->scrollBar.offset((qreal)messages.size()); + } } }