X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatline.cpp;h=f6ea50f9b88b69e1aafc646f6db831b38ae3a5db;hb=5faebde94b5a6be7e0865c9e3ab90cbcb50ad9c3;hp=1c7db84c11a20a01662e86fb692bd915aa7af993;hpb=2c16b8e356817cb4a4bf7fcd59c0c7429b0100e1;p=quassel.git 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