Wait for smooth scrolling animation to add new message (#2084)
Co-authored-by: Paweł <zneix@zneix.eu> Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -785,6 +785,18 @@ void ChannelView::messageAppended(MessagePtr &message,
|
||||
this->lastMessageHasAlternateBackground_ =
|
||||
!this->lastMessageHasAlternateBackground_;
|
||||
|
||||
if (!this->scrollBar_->isAtBottom() &&
|
||||
this->scrollBar_->getCurrentValueAnimation().state() ==
|
||||
QPropertyAnimation::Running)
|
||||
{
|
||||
QEventLoop loop;
|
||||
|
||||
connect(&this->scrollBar_->getCurrentValueAnimation(),
|
||||
&QAbstractAnimation::stateChanged, &loop, &QEventLoop::quit);
|
||||
|
||||
loop.exec();
|
||||
}
|
||||
|
||||
if (this->messages_.pushBack(MessageLayoutPtr(messageRef), deleted))
|
||||
{
|
||||
if (this->paused())
|
||||
|
||||
Reference in New Issue
Block a user