This commit is contained in:
Kovid Goyal 2012-06-02 10:18:26 +05:30
parent 5a4ea8c01c
commit caaad44983

View File

@ -49,7 +49,9 @@ class RichTextDelegate(QStyledItemDelegate): # {{{
doc = QTextDocument()
if option is not None and option.state & QStyle.State_Selected:
p = option.palette
c = p.color(p.Active, p.HighlightedText)
group = (p.Active if option.state & QStyle.State_Active else
p.Inactive)
c = p.color(group, p.HighlightedText)
c = 'rgb(%d, %d, %d)'%c.getRgb()[:3]
doc.setDefaultStyleSheet(' * { color: %s }'%c)
doc.setHtml(index.data().toString())