mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Scroll to the bottom on new messages
Bug introduced on the last commit
This commit is contained in:
parent
ac8e42b926
commit
513f69e88a
1 changed files with 6 additions and 1 deletions
|
@ -82,8 +82,10 @@ TimelineView::sliderRangeChanged(int min, int max)
|
|||
|
||||
// If the scrollbar is close to the bottom and a new message
|
||||
// is added we move the scrollbar.
|
||||
if (max - scroll_area_->verticalScrollBar()->value() < SCROLL_BAR_GAP)
|
||||
if (max - scroll_area_->verticalScrollBar()->value() < SCROLL_BAR_GAP) {
|
||||
scroll_area_->verticalScrollBar()->setValue(max);
|
||||
return;
|
||||
}
|
||||
|
||||
int currentHeight = scroll_widget_->size().height();
|
||||
int diff = currentHeight - oldHeight_;
|
||||
|
@ -94,6 +96,9 @@ TimelineView::sliderRangeChanged(int min, int max)
|
|||
newPosition = max;
|
||||
|
||||
scroll_area_->verticalScrollBar()->setValue(newPosition);
|
||||
|
||||
scroll_widget_->adjustSize();
|
||||
scroll_widget_->update();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue