summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-10-09 13:59:44 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-10-09 13:59:44 +0300
commit513f69e88a210a90df82fcac213bb171a7d573ff (patch)
tree26ea7c4f7102eb77e49cf45df50875f665472005 /src
parentac8e42b9265bbdc2b3a386e01787a6ee9cfb0180 (diff)
Scroll to the bottom on new messages
Bug introduced on the last commit
Diffstat (limited to 'src')
-rw-r--r--src/TimelineView.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/TimelineView.cc b/src/TimelineView.cc
index 08b46fdd..615127a4 100644
--- a/src/TimelineView.cc
+++ b/src/TimelineView.cc
@@ -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