X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatline-old.cpp;h=497017da684e97e37db3e2f7f0263f6178370272;hb=536ef19e7f9487db60ae3a99494d8b2870b13cff;hp=c1cd7d2ff970d805aca446b8592f27a1722e4460;hpb=56c684447058042182308ad35cd9446601779016;p=quassel.git diff --git a/src/qtui/chatline-old.cpp b/src/qtui/chatline-old.cpp index c1cd7d2f..497017da 100644 --- a/src/qtui/chatline-old.cpp +++ b/src/qtui/chatline-old.cpp @@ -29,17 +29,21 @@ /** * \param m The message to be layouted and rendered */ -ChatLineOld::ChatLineOld(Message m) { +QColor ChatLineOld::_highlightColor; +ChatLineOld::ChatLineOld(const Message &m) { hght = 0; - msg = m; selectionMode = None; isHighlight = false; formatMsg(msg); + + if(!_highlightColor.isValid()) { + QtUiSettings s("QtUi/Colors"); + _highlightColor = s.value("highlightColor", QVariant(QColor("lightcoral"))).value(); + } } ChatLineOld::~ChatLineOld() { - } void ChatLineOld::formatMsg(Message msg) { @@ -318,10 +322,8 @@ void ChatLineOld::draw(QPainter *p, const QPointF &pos) { p->drawRect(QRectF(pos, QSizeF(tsWidth + QtUi::style()->sepTsSender() + senderWidth + QtUi::style()->sepSenderText() + textWidth, height()))); } else { if(isHighlight) { - QtUiSettings s("QtUi/Colors"); - QColor highlightColor = s.value("highlightColor", QVariant(QColor("lightcoral"))).value(); p->setPen(Qt::NoPen); - p->setBrush(highlightColor /*pal.brush(QPalette::AlternateBase) */); + p->setBrush(_highlightColor /*pal.brush(QPalette::AlternateBase) */); p->drawRect(QRectF(pos, QSizeF(tsWidth + QtUi::style()->sepTsSender() + senderWidth + QtUi::style()->sepSenderText() + textWidth, height()))); } if(selectionMode == Partial) {