X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatview.h;h=0f90a668b0b8ca12789856836533f9dacac96bb6;hp=d624e059184bc15b9e87ab27c86505145ec5711e;hb=26406e4c1f049a021fd99fd6592389289a510e99;hpb=c1cf157116de7fc3da96203aa6f03c38c7ebb650 diff --git a/src/qtui/chatview.h b/src/qtui/chatview.h index d624e059..0f90a668 100644 --- a/src/qtui/chatview.h +++ b/src/qtui/chatview.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 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 * @@ -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