X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fbufferwidget.cpp;h=55ac17284854dc6072e9615fc27a486d19ec6017;hb=24c7de34254b5de4cf28045a6923a527e06f7290;hp=5eec57195bb2adb24dbe3e0b14fb760e98b0ce7b;hpb=cc6e7c08709c4e761e2fd9c2e322751015497003;p=quassel.git diff --git a/src/qtui/bufferwidget.cpp b/src/qtui/bufferwidget.cpp index 5eec5719..55ac1728 100644 --- a/src/qtui/bufferwidget.cpp +++ b/src/qtui/bufferwidget.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2019 by the Quassel Project * + * Copyright (C) 2005-2022 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -27,6 +27,7 @@ #include "action.h" #include "actioncollection.h" +#include "backlogsettings.h" #include "chatline.h" #include "chatview.h" #include "chatviewsearchbar.h" @@ -83,6 +84,9 @@ BufferWidget::BufferWidget(QWidget* parent) 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() @@ -101,6 +105,11 @@ void BufferWidget::setAutoMarkerLineOnLostFocus(const QVariant& v) _autoMarkerLineOnLostFocus = v.toBool(); } +void BufferWidget::setEnsureBacklogOnBufferShow(const QVariant& v) +{ + _ensureBacklogOnBufferShow = v.toBool(); +} + AbstractChatView* BufferWidget::createChatView(BufferId id) { ChatView* chatView; @@ -132,6 +141,10 @@ void BufferWidget::showChatView(BufferId id) Q_ASSERT(view); ui.stackedWidget->setCurrentWidget(view); _chatViewSearchController->setScene(view->scene()); + if (_ensureBacklogOnBufferShow) { + // Try to ensure some messages are visible + view->requestBacklogForScroll(); + } } }