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 \
|
style = QApplication.style() if option.widget is None \
|
||||||
else option.widget.style()
|
else option.widget.style()
|
||||||
self.document.setHtml(option.text)
|
self.document.setHtml(option.text)
|
||||||
option.text = u''
|
|
||||||
style.drawPrimitive(QStyle.PE_PanelItemViewItem, option, painter, widget=option.widget)
|
style.drawPrimitive(QStyle.PE_PanelItemViewItem, option, painter, widget=option.widget)
|
||||||
ctx = QAbstractTextDocumentLayout.PaintContext()
|
ctx = QAbstractTextDocumentLayout.PaintContext()
|
||||||
ctx.palette = option.palette
|
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)
|
textRect = style.subElementRect(QStyle.SE_ItemViewItemText, option)
|
||||||
painter.save()
|
painter.save()
|
||||||
painter.translate(textRect.topLeft())
|
painter.translate(textRect.topLeft())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user