Specify completion category font in HTML

It seems like specifying a font for QTreeView::item in a Qt stylesheet
doesn't actually do anything.
This commit is contained in:
Florian Bruhin 2016-08-01 14:56:51 +02:00
parent fca3c28134
commit c421f44f4e
2 changed files with 4 additions and 2 deletions

View File

@ -206,7 +206,10 @@ class CompletionItemDelegate(QStyledItemDelegate):
else:
self._doc.setPlainText(self._opt.text)
else:
self._doc.setHtml(html.escape(self._opt.text))
self._doc.setHtml(
'<span style="font: {};">{}</span>'.format(
html.escape(config.get('fonts', 'completion.category')),
html.escape(self._opt.text)))
def _draw_focus_rect(self):
"""Draw the focus rectangle of an ItemViewItem."""

View File

@ -69,7 +69,6 @@ class CompletionView(QTreeView):
{{ color['completion.category.border.top'] }};
border-bottom: 1px solid
{{ color['completion.category.border.bottom'] }};
font: {{ font['completion.category'] }};
}
QTreeView::item:selected, QTreeView::item:selected:hover {