Refactoring to resolve issue #1395

This commit is contained in:
nanjekyejoannah 2016-08-01 14:00:30 +03:00
parent 212d5fe932
commit 1e94685653
3 changed files with 8 additions and 16 deletions

View File

@ -206,7 +206,7 @@ class CompletionItemDelegate(QStyledItemDelegate):
else:
self._doc.setPlainText(self._opt.text)
else:
self._doc.setHtml('{}'.format(html.escape(self._opt.text)))
self._doc.setHtml(html.escape(self._opt.text))
def _draw_focus_rect(self):
"""Draw the focus rectangle of an ItemViewItem."""

View File

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

View File

@ -120,6 +120,7 @@ SECTION_DESC = {
DEFAULT_FONT_SIZE = '10pt' if sys.platform == 'darwin' else '8pt'
orientation = 'bold'
def data(readonly=False):
@ -466,18 +467,6 @@ def data(readonly=False):
SettingValue(typ.Int(minval=0), '2'),
"Padding of scrollbar handle in completion window (in px)."),
('_monospace',
SettingValue(typ.Font(), 'Terminus, Monospace, '
'"DejaVu Sans Mono", Monaco, '
'"Bitstream Vera Sans Mono", "Andale Mono", '
'"Courier New", Courier, "Liberation Mono", '
'monospace, Fixed, Consolas, Terminal'),
"Default monospace fonts."),
('bold',
SettingValue(typ.Font(), 'bold' + DEFAULT_FONT_SIZE + ' ${_monospace}' ),
"Font used in the completion fonts."),
readonly=readonly
)),
@ -1256,6 +1245,9 @@ def data(readonly=False):
SettingValue(typ.Font(), DEFAULT_FONT_SIZE + ' ${_monospace}'),
"Font used in the completion widget."),
('completion.category',
SettingValue(typ.Font(), 'bold' + '${completion}'),
"Font used in the completion fonts."),
('tabbar',
SettingValue(typ.QtFont(), DEFAULT_FONT_SIZE + ' ${_monospace}'),