refactor: cleanup and document Scrollbar (#5334)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
Co-authored-by: Daniel Sage <sagedanielr@gmail.com>
This commit is contained in:
nerix
2024-05-12 12:52:58 +02:00
committed by GitHub
parent 5c539ebe9a
commit 8202cd0d99
11 changed files with 453 additions and 225 deletions
+3 -3
View File
@@ -744,7 +744,7 @@ void ChannelView::updateScrollbar(
if (h < 0) // break condition
{
this->scrollBar_->setLargeChange(
this->scrollBar_->setPageSize(
(messages.size() - i) +
qreal(h) / std::max<int>(1, message->getHeight()));
@@ -778,7 +778,7 @@ void ChannelView::clearMessages()
// Clear all stored messages in this chat widget
this->messages_.clear();
this->scrollBar_->clearHighlights();
this->scrollBar_->resetMaximum();
this->scrollBar_->resetBounds();
this->scrollBar_->setMaximum(0);
this->scrollBar_->setMinimum(0);
this->queueLayout();
@@ -1277,7 +1277,7 @@ void ChannelView::messagesUpdated()
this->messages_.clear();
this->scrollBar_->clearHighlights();
this->scrollBar_->resetMaximum();
this->scrollBar_->resetBounds();
this->scrollBar_->setMaximum(qreal(snapshot.size()));
this->scrollBar_->setMinimum(0);
this->lastMessageHasAlternateBackground_ = false;