X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatline-old.cpp;h=b3b16832f2642c3a52f8cbaec3251bbf1721f26d;hb=85583b32135dd4028edecef9029661dd11919150;hp=d2f55be962f1df5641cf9bdd04adf744a788fbac;hpb=e733408e4759473bf38831f498f48a0f2f5e6dc7;p=quassel.git diff --git a/src/qtui/chatline-old.cpp b/src/qtui/chatline-old.cpp index d2f55be9..b3b16832 100644 --- a/src/qtui/chatline-old.cpp +++ b/src/qtui/chatline-old.cpp @@ -19,6 +19,8 @@ ***************************************************************************/ #include "chatline-old.h" +#include "client.h" +#include "network.h" #include "qtui.h" //! Construct a ChatLine object from a message. @@ -31,6 +33,7 @@ ChatLine::ChatLine(Message m) { //bufferName = m.buffer.buffer(); msg = m; selectionMode = None; + isHighlight = false; formatMsg(msg); } @@ -39,6 +42,7 @@ ChatLine::~ChatLine() { } void ChatLine::formatMsg(Message msg) { + isHighlight = msg.flags() & Message::Highlight; QTextOption tsOption, senderOption, textOption; styledTimeStamp = QtUi::style()->styleString(msg.formattedTimestamp()); styledSender = QtUi::style()->styleString(msg.formattedSender()); @@ -138,7 +142,7 @@ MsgId ChatLine::msgId() const { } BufferInfo ChatLine::bufferInfo() const { - return msg.buffer(); + return msg.bufferInfo(); } QDateTime ChatLine::timestamp() const { @@ -314,8 +318,15 @@ void ChatLine::draw(QPainter *p, const QPointF &pos) { p->setPen(Qt::NoPen); p->setBrush(pal.brush(QPalette::Highlight)); p->drawRect(QRectF(pos, QSizeF(tsWidth + QtUi::style()->sepTsSender() + senderWidth + QtUi::style()->sepSenderText() + textWidth, height()))); - } else if(selectionMode == Partial) { + } else { + if(isHighlight) { + p->setPen(Qt::NoPen); + p->setBrush(pal.brush(QPalette::AlternateBase)); + p->drawRect(QRectF(pos, QSizeF(tsWidth + QtUi::style()->sepTsSender() + senderWidth + QtUi::style()->sepSenderText() + textWidth, height()))); + } + if(selectionMode == Partial) { + } } /* p->setClipRect(QRectF(pos, QSizeF(tsWidth, height()))); tsLayout.draw(p, pos, tsFormat); @@ -345,6 +356,7 @@ void ChatLine::draw(QPainter *p, const QPointF &pos) { } QPointF tpos = pos + QPointF(tsWidth + QtUi::style()->sepTsSender() + senderWidth + QtUi::style()->sepSenderText(), 0); qreal h = 0; int l = 0; + if(lineLayouts.count() == 0) return; // how can this happen? rect = QRectF(tpos + QPointF(0, h), QSizeF(textWidth, lineLayouts[l].height)); int offset = 0; foreach(FormatRange fr, textFormat) {