X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatview.h;h=79222ef3f645543a0ffb89dbd7ed11a2c128561c;hp=a4fd8840e6fa82d65615c3ebb00d331f89684329;hb=HEAD;hpb=a95ad2de573027f9bee36db972bcae4195168d0c diff --git a/src/qtui/chatview.h b/src/qtui/chatview.h index a4fd8840..79222ef3 100644 --- a/src/qtui/chatview.h +++ b/src/qtui/chatview.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2020 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 * @@ -79,6 +79,17 @@ public: */ void setHasCache(ChatLine* line, bool hasCache = true); + /** + * Requests backlog if the scrollbar is not currently visible + * + * Use this whenever trying to scroll the backlog to try to ensure some text is visible. If the + * backlog does not have additional messages or those messages are filtered out, the scrollbar + * might remain invisible. + * + * @return True if the scrollbar isn't visible and a backlog request was made, otherwise false + */ + bool requestBacklogForScroll(); + public slots: inline virtual void clear() {} void zoomIn(); @@ -91,6 +102,7 @@ public slots: protected: bool event(QEvent* event) override; + bool eventFilter(QObject* watched, QEvent* event) override; void resizeEvent(QResizeEvent* event) override; void scrollContentsBy(int dx, int dy) override; @@ -118,6 +130,8 @@ private: bool _invalidateFilter; QSet _linesWithCache; bool _firstTouchUpdateHappened = false; + /// Workaround: If true, backlog has been requested before the vertical scrollbar became visible + bool _backlogRequestedBeforeScrollable{false}; }; #endif