X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatline.cpp;h=f6ea50f9b88b69e1aafc646f6db831b38ae3a5db;hp=1c7db84c11a20a01662e86fb692bd915aa7af993;hb=c6a6c0e4317986792320826956fd5ead2b3e9e67;hpb=0edcf393c9aaab06f7db904bea1da0b7352f1ed7 diff --git a/src/qtui/chatline.cpp b/src/qtui/chatline.cpp index 1c7db84c..f6ea50f9 100644 --- a/src/qtui/chatline.cpp +++ b/src/qtui/chatline.cpp @@ -165,11 +165,13 @@ void ChatLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, painter->fillRect(boundingRect(), msgFmt.background()); } - // TODO make this dependent on the style engine (highlight-color & friends) if(_selection & Selected) { - qreal left = item((ChatLineModel::ColumnType)(_selection & ItemMask)).x(); - QRectF selectRect(left, 0, width() - left, height()); - painter->fillRect(selectRect, QApplication::palette().brush(QPalette::Highlight)); + QTextCharFormat selFmt = QtUi::style()->format(UiStyle::formatType(type), label | UiStyle::Selected); + if(selFmt.hasProperty(QTextFormat::BackgroundBrush)) { + qreal left = item((ChatLineModel::ColumnType)(_selection & ItemMask)).x(); + QRectF selectRect(left, 0, width() - left, height()); + painter->fillRect(selectRect, selFmt.background()); + } } // new line marker