From 285c72a83d33cd3f2992b3e4c0b0298bd401a5ee Mon Sep 17 00:00:00 2001 From: fourtf Date: Tue, 26 Dec 2017 17:15:23 +0100 Subject: [PATCH] fixed "jump to bottom" now disapearing after click --- src/widgets/helper/channelview.cpp | 9 ++++----- src/widgets/scrollbar.cpp | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/widgets/helper/channelview.cpp b/src/widgets/helper/channelview.cpp index 696d76266..d6c51b12b 100644 --- a/src/widgets/helper/channelview.cpp +++ b/src/widgets/helper/channelview.cpp @@ -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() diff --git a/src/widgets/scrollbar.cpp b/src/widgets/scrollbar.cpp index 90eee65e9..43cda1f3b 100644 --- a/src/widgets/scrollbar.cpp +++ b/src/widgets/scrollbar.cpp @@ -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; }