+bool ChatView::requestBacklogForScroll()
+{
+ if (!verticalScrollBar()->isVisible()) {
+ // Not able to scroll, fetch backlog
+ //
+ // Future improvement: continue fetching backlog in chunks until the scrollbar is visible,
+ // or the beginning of the buffer has been reached.
+ scene()->requestBacklog();
+ // Backlog has been requested
+ return true;
+ }
+ else {
+ // Scrollbar already visible, no backlog requested
+ return false;
+ }
+}
+