/***************************************************************************
- * 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 *
*/
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();
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;
bool _invalidateFilter;
QSet<ChatLine*> _linesWithCache;
bool _firstTouchUpdateHappened = false;
+ /// Workaround: If true, backlog has been requested before the vertical scrollbar became visible
+ bool _backlogRequestedBeforeScrollable{false};
};
#endif