mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Proper text color for highlighted comment cells
This commit is contained in:
parent
c049cdfe8d
commit
0dab878ad5
@ -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())
|
||||
|
Loading…
x
Reference in New Issue
Block a user