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
BufferId bufferId = BufferId(chatScene()->idString().toInt());
MsgId lastSeenMsgId = Client::networkModel()->lastSeenMarkerMsgId(bufferId);
if(lastSeenMsgId < myMsgId && lastSeenMsgId >= prevMsgId) {
- QtUiStyleSettings s("Colors");
QLinearGradient gradient(0, 0, 0, contentsItem().fontMetrics()->lineSpacing());
- gradient.setColorAt(0, s.value("newMsgMarkerFG", QColor(Qt::red)).value<QColor>());
+ gradient.setColorAt(0, QtUi::style()->markerLineBrush().color()); // FIXME: Use full (gradient?) brush instead of just the color
gradient.setColorAt(0.1, Qt::transparent);
painter->fillRect(boundingRect(), gradient);
}