fixed "jump to bottom" now disapearing after click

This commit is contained in:
fourtf 2017-12-26 17:15:23 +01:00
parent a51735baae
commit 285c72a83d
2 changed files with 6 additions and 7 deletions

View file

@ -45,7 +45,6 @@ ChannelView::ChannelView(BaseWidget *parent)
this->scrollBar.getCurrentValueChanged().connect([this] {
// Whenever the scrollbar value has been changed, re-render the ChatWidgetView
this->layoutMessages();
this->goToBottom->setVisible(this->scrollBar.isVisible() && !this->scrollBar.isAtBottom());
this->queueUpdate();
@ -93,13 +92,13 @@ ChannelView::~ChannelView()
void ChannelView::queueUpdate()
{
if (this->updateTimer.isActive()) {
this->updateQueued = true;
}
// if (this->updateTimer.isActive()) {
// this->updateQueued = true;
// }
update();
this->updateTimer.start();
// this->updateTimer.start();
}
void ChannelView::layoutMessages()

View file

@ -130,19 +130,19 @@ void ScrollBar::setDesiredValue(qreal value, bool animated)
// }
this->currentValueAnimation.setEndValue(value);
this->smoothScrollingOffset = 0;
this->atBottom = ((this->getMaximum() - this->getLargeChange()) - value) <= 0.01;
this->currentValueAnimation.start();
} else {
if (this->currentValueAnimation.state() != QPropertyAnimation::Running) {
this->smoothScrollingOffset = 0;
this->desiredValue = value;
this->currentValueAnimation.stop();
this->atBottom = ((this->getMaximum() - this->getLargeChange()) - value) <= 0.01;
setCurrentValue(value);
}
}
}
this->atBottom = ((this->getMaximum() - this->getLargeChange()) - value) <= 0.01;
this->smoothScrollingOffset = 0;
this->desiredValue = value;
}