/***************************************************************************
- * Copyright (C) 2005-2019 by the Quassel Project *
+ * Copyright (C) 2005-2020 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include "action.h"
#include "actioncollection.h"
+#include "backlogsettings.h"
#include "chatline.h"
#include "chatview.h"
#include "chatviewsearchbar.h"
ChatViewSettings s;
s.initAndNotify("AutoMarkerLine", this, &BufferWidget::setAutoMarkerLine, true);
s.initAndNotify("AutoMarkerLineOnLostFocus", this, &BufferWidget::setAutoMarkerLineOnLostFocus, true);
+
+ BacklogSettings backlogSettings;
+ backlogSettings.initAndNotify("EnsureBacklogOnBufferShow", this, &BufferWidget::setEnsureBacklogOnBufferShow, true);
}
BufferWidget::~BufferWidget()
_autoMarkerLineOnLostFocus = v.toBool();
}
+void BufferWidget::setEnsureBacklogOnBufferShow(const QVariant& v)
+{
+ _ensureBacklogOnBufferShow = v.toBool();
+}
+
AbstractChatView* BufferWidget::createChatView(BufferId id)
{
ChatView* chatView;
Q_ASSERT(view);
ui.stackedWidget->setCurrentWidget(view);
_chatViewSearchController->setScene(view->scene());
+ if (_ensureBacklogOnBufferShow) {
+ // Try to ensure some messages are visible
+ view->requestBacklogForScroll();
+ }
}
}