fix: smoothScrollingNewMessages sometimes hiding messages (#4028)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix 2022-10-01 14:05:05 +02:00 committed by GitHub
parent 5e02fdab52
commit b5241670ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -67,6 +67,7 @@
- Bugfix: Mentions of "You" in timeouts will link to your own user now instead of the user "You". (#3922)
- Bugfix: Fixed emoji popup not being shown in IRC channels (#4021)
- Bugfix: Fixed non-global FrankerFaceZ emotes from being loaded as global emotes. (#3921)
- Bugfix: Fixed `Smooth scrolling on new messages` setting sometimes hiding messages. (#4028)
- Dev: Removed official support for QMake. (#3839, #3883)
- Dev: Rewrote LimitedQueue (#3798)
- Dev: Overhauled highlight system by moving all checks into a Controller allowing for easier tests. (#3399, #3801, #3835)

View file

@ -120,7 +120,7 @@ void Scrollbar::setDesiredValue(qreal value, bool animated)
value = std::max(this->minimum_,
std::min(this->maximum_ - this->largeChange_, value));
if (std::abs(this->desiredValue_ + this->smoothScrollingOffset_ - value) >
if (std::abs(this->currentValue_ + this->smoothScrollingOffset_ - value) >
0.0001)
{
if (animated)
@ -142,8 +142,12 @@ void Scrollbar::setDesiredValue(qreal value, bool animated)
}
else
{
if (this->currentValueAnimation_.state() !=
if (this->currentValueAnimation_.state() ==
QPropertyAnimation::Running)
{
this->currentValueAnimation_.setEndValue(value);
}
else
{
this->smoothScrollingOffset_ = 0;
this->desiredValue_ = value;