mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
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:
parent
62bf843aaf
commit
24a2d8a86f
|
@ -2,6 +2,8 @@
|
|||
|
||||
## Unversioned
|
||||
|
||||
- Bugfix: Fixed visual glitch with smooth scrolling. (#2084)
|
||||
|
||||
## 2.3.0
|
||||
|
||||
- Major: Added custom FrankerFaceZ VIP Badges. (#2628)
|
||||
|
|
|
@ -188,6 +188,11 @@ qreal Scrollbar::getCurrentValue() const
|
|||
return this->currentValue_;
|
||||
}
|
||||
|
||||
const QPropertyAnimation &Scrollbar::getCurrentValueAnimation() const
|
||||
{
|
||||
return this->currentValueAnimation_;
|
||||
}
|
||||
|
||||
void Scrollbar::offset(qreal value)
|
||||
{
|
||||
if (this->currentValueAnimation_.state() == QPropertyAnimation::Running)
|
||||
|
|
|
@ -44,6 +44,8 @@ public:
|
|||
qreal getDesiredValue() const;
|
||||
qreal getCurrentValue() const;
|
||||
|
||||
const QPropertyAnimation &getCurrentValueAnimation() const;
|
||||
|
||||
// offset the desired value without breaking smooth scolling
|
||||
void offset(qreal value);
|
||||
pajlada::Signals::NoArgSignal &getCurrentValueChanged();
|
||||
|
|
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue