diff --git a/src/calibre/gui2/library/delegates.py b/src/calibre/gui2/library/delegates.py index f137e5ed99..2d383cdb68 100644 --- a/src/calibre/gui2/library/delegates.py +++ b/src/calibre/gui2/library/delegates.py @@ -415,10 +415,11 @@ class CcCommentsDelegate(QStyledItemDelegate): # {{{ style = QApplication.style() if option.widget is None \ else option.widget.style() self.document.setHtml(option.text) - option.text = u'' style.drawPrimitive(QStyle.PE_PanelItemViewItem, option, painter, widget=option.widget) ctx = QAbstractTextDocumentLayout.PaintContext() ctx.palette = option.palette + if option.state & QStyle.State_Selected: + ctx.palette.setColor(ctx.palette.Text, ctx.palette.color(ctx.palette.HighlightedText)) textRect = style.subElementRect(QStyle.SE_ItemViewItemText, option) painter.save() painter.translate(textRect.topLeft())