X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatline.cpp;h=af77b12ca5a29ddf51983b534daefb0dd9efe764;hp=0e4df2268c91a944df1c165e9c93fa0291857464;hb=9d22ec1fd8e8652744e6ea6c91de4a6ec5b2146c;hpb=ba9de06a8634a30863d54001cb8f934746333d58 diff --git a/src/qtui/chatline.cpp b/src/qtui/chatline.cpp index 0e4df226..af77b12c 100644 --- a/src/qtui/chatline.cpp +++ b/src/qtui/chatline.cpp @@ -23,8 +23,12 @@ #include #include "bufferinfo.h" +#include "buffersyncer.h" +#include "client.h" #include "chatitem.h" #include "chatline.h" +#include "messagemodel.h" +#include "networkmodel.h" #include "qtui.h" ChatLine::ChatLine(int row, QAbstractItemModel *model, QGraphicsItem *parent) @@ -114,4 +118,18 @@ void ChatLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QRectF selectRect(left, 0, width() - left, height()); painter->fillRect(selectRect, QApplication::palette().brush(QPalette::Highlight)); } + + const QAbstractItemModel *model_ = model(); + if(model_ && row() > 0) { + MsgId msgId = model_->data(model_->index(row() - 1, 0), MessageModel::MsgIdRole).value(); + BufferId bufferId = model_->data(model_->index(row() - 1, 0), MessageModel::BufferIdRole).value(); + if(msgId == Client::networkModel()->lastSeenMsgId(bufferId) && chatScene()->isSingleBufferScene()) { + QLinearGradient gradient(0, 0, 0, height()); + gradient.setColorAt(0, Qt::transparent); + gradient.setColorAt(1, Qt::red); + painter->fillRect(boundingRect(), gradient); + } + } + + }