X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatscene.h;h=e0aaa500df894e79ffa1acead874652e1d144437;hb=339ed024e6cf074108e39360e7db58ea0961761b;hp=f54869b32d906d4ccc9c7d26b0a92650778b5088;hpb=642ccc0534c82498a4740931c6707bd419224688;p=quassel.git diff --git a/src/qtui/chatscene.h b/src/qtui/chatscene.h index f54869b3..e0aaa500 100644 --- a/src/qtui/chatscene.h +++ b/src/qtui/chatscene.h @@ -26,7 +26,7 @@ #include #include "columnhandleitem.h" - +#include "messagefilter.h" class AbstractUiMsg; class ChatItem; @@ -47,12 +47,14 @@ public: int sectionByScenePos(int x); inline int sectionByScenePos(const QPoint &pos) { return sectionByScenePos(pos.x()); } inline bool isSingleBufferScene() const { return _singleBufferScene; } + inline bool containsBuffer(const BufferId &id) const; inline ChatLine *chatLine(int row) { return (row < _lines.count()) ? _lines[row] : 0; } inline ColumnHandleItem *firstColumnHandle() const { return firstColHandle; } inline ColumnHandleItem *secondColumnHandle() const { return secondColHandle; } public slots: + void updateForViewport(qreal width, qreal height); void setWidth(qreal, bool forceReposition = false); // these are used by the chatitems to notify the scene and manage selections @@ -64,7 +66,7 @@ public slots: void requestBacklog(); signals: - void sceneHeightChanged(qreal dh); + void lastLineChanged(QGraphicsItem *); protected: virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent); @@ -92,6 +94,7 @@ private: // we store the size in a member variable. QRectF _sceneRect; void updateSceneRect(const QRectF &rect); + qreal _viewportHeight; ColumnHandleItem *firstColHandle, *secondColHandle; qreal firstColHandlePos, secondColHandlePos; @@ -106,4 +109,12 @@ private: int _lastBacklogSize; }; +bool ChatScene::containsBuffer(const BufferId &id) const { + MessageFilter *filter = qobject_cast(model()); + if(filter) + return filter->containsBuffer(id); + else + return false; +} + #endif