From 40fd2239205d9926296ccf60474a1aeb53c06c53 Mon Sep 17 00:00:00 2001 From: Alexander von Renteln Date: Tue, 15 Apr 2008 14:57:26 +0000 Subject: [PATCH] chatline: highlightcolor is only loaded once in the init userinputhandler: removed a qdebug, i forgot to remove --- src/core/userinputhandler.cpp | 1 - src/qtui/chatline-old.cpp | 7 ++++--- src/qtui/chatline-old.h | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/userinputhandler.cpp b/src/core/userinputhandler.cpp index 618bc8da..0ef5aba0 100644 --- a/src/core/userinputhandler.cpp +++ b/src/core/userinputhandler.cpp @@ -92,7 +92,6 @@ void UserInputHandler::handleBan(const BufferInfo &bufferInfo, const QString &ms } QString banMsg = QString("MODE %1 +b %2").arg(banChannel).arg(banUser); - qDebug() << banMsg; emit putRawLine(serverEncode(banMsg)); } diff --git a/src/qtui/chatline-old.cpp b/src/qtui/chatline-old.cpp index c1cd7d2f..2df6bbb4 100644 --- a/src/qtui/chatline-old.cpp +++ b/src/qtui/chatline-old.cpp @@ -36,6 +36,9 @@ ChatLineOld::ChatLineOld(Message m) { selectionMode = None; isHighlight = false; formatMsg(msg); + + QtUiSettings s("QtUi/Colors"); + _highlightColor = s.value("highlightColor", QVariant(QColor("lightcoral"))).value(); } ChatLineOld::~ChatLineOld() { @@ -318,10 +321,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) { diff --git a/src/qtui/chatline-old.h b/src/qtui/chatline-old.h index 8d286b07..f4877a96 100644 --- a/src/qtui/chatline-old.h +++ b/src/qtui/chatline-old.h @@ -106,6 +106,8 @@ class ChatLineOld : public QObject, public AbstractUiMsg { void precomputeLine(); QList calcFormatRanges(const UiStyle::StyledText &); QList calcFormatRanges(const UiStyle::StyledText &, const QTextLayout::FormatRange &additional); + + QColor _highlightColor; }; #endif -- 2.20.1