X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatview.h;h=51522d2355152920845b5e6c9306a2ee41618d4b;hp=3f9e29c96e7c97ac8ace60074343943b1276288b;hb=a72e2b4a90ce18c58b54e111161691ba008dc47d;hpb=e19eef8ec30a926e5a847a7570bb966bc86f602e diff --git a/src/qtui/chatview.h b/src/qtui/chatview.h index 3f9e29c9..51522d23 100644 --- a/src/qtui/chatview.h +++ b/src/qtui/chatview.h @@ -65,14 +65,18 @@ public: /** Using this method more efficient than calling visibleChatLinesSorted() and taking its last element. * \return The last fully visible ChatLine in the view */ - ChatLine *lastVisibleChatLine() const; + ChatLine *lastVisibleChatLine(bool ignoreDayChange = false) const; virtual void addActionsToMenu(QMenu *, const QPointF &pos); - virtual bool event(QEvent *event); - - inline bool isMarkerLineVisible() const { return _markerLineVisible; } - inline ChatLine *markedLine() const { return _markedLine; } + //! Tell the view that this ChatLine has cached data + /** ChatLines cache some layout data that should be cleared as soon as it's no + * longer visible. A ChatLine caching data registers itself with this method to + * tell the view about it. The view will call ChatLine::clearCache() when + * appropriate. + * \param line The ChatLine having cached data + */ + void setHasCache(ChatLine *line, bool hasCache = true); public slots: inline virtual void clear() {} @@ -81,10 +85,13 @@ public slots: void zoomOriginal(); void setMarkerLineVisible(bool visible = true); - void setMarkedLine(ChatLine *line); + void setMarkerLine(MsgId msgId); + void jumpToMarkerLine(bool requestBacklog); protected: + virtual bool event(QEvent *event); virtual void resizeEvent(QResizeEvent *event); + virtual void scrollContentsBy(int dx, int dy); protected slots: virtual void verticalScrollbarChanged(int); @@ -92,6 +99,7 @@ protected slots: private slots: void lastLineChanged(QGraphicsItem *chatLine, qreal offset); void adjustSceneRect(); + void checkChatLineCaches(); void mouseMoveWhileSelecting(const QPointF &scenePos); void scrollTimerTimeout(); void invalidateFilter(); @@ -107,8 +115,7 @@ private: QTimer _scrollTimer; int _scrollOffset; bool _invalidateFilter; - bool _markerLineVisible; - ChatLine *_markedLine; + QSet _linesWithCache; };