***************************************************************************/
#include "chatline-old.h"
+#include "client.h"
+#include "network.h"
#include "qtui.h"
//! Construct a ChatLine object from a message.
//bufferName = m.buffer.buffer();
msg = m;
selectionMode = None;
+ isHighlight = false;
formatMsg(msg);
}
}
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());
}
}
-uint ChatLine::msgId() const {
- return msg.buffer().uid();
+MsgId ChatLine::msgId() const {
+ return msg.msgId();
}
BufferInfo ChatLine::bufferInfo() const {
- return msg.buffer();
+ return msg.bufferInfo();
}
QDateTime ChatLine::timestamp() const {
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);
}
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) {