mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
...
This commit is contained in:
parent
8ead6c26f0
commit
db3bd2d25c
@ -552,13 +552,12 @@ class CcMarkdownDelegate(QStyledItemDelegate): # {{{
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
QStyledItemDelegate.__init__(self, parent)
|
super().__init__(parent)
|
||||||
self.document = QTextDocument()
|
self.document = QTextDocument()
|
||||||
|
|
||||||
def paint(self, painter, option, index):
|
def paint(self, painter, option, index):
|
||||||
self.initStyleOption(option, index)
|
self.initStyleOption(option, index)
|
||||||
style = QApplication.style() if option.widget is None \
|
style = QApplication.style() if option.widget is None else option.widget.style()
|
||||||
else option.widget.style()
|
|
||||||
option.text = markdown(option.text)
|
option.text = markdown(option.text)
|
||||||
self.document.setHtml(option.text)
|
self.document.setHtml(option.text)
|
||||||
style.drawPrimitive(QStyle.PrimitiveElement.PE_PanelItemViewItem, option, painter, widget=option.widget)
|
style.drawPrimitive(QStyle.PrimitiveElement.PE_PanelItemViewItem, option, painter, widget=option.widget)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user