From 1e946856537e8b5a9cc6a00504aebeeb710f6017 Mon Sep 17 00:00:00 2001 From: nanjekyejoannah Date: Mon, 1 Aug 2016 14:00:30 +0300 Subject: [PATCH] Refactoring to resolve issue #1395 --- qutebrowser/completion/completiondelegate.py | 2 +- qutebrowser/completion/completionwidget.py | 2 +- qutebrowser/config/configdata.py | 20 ++++++-------------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/qutebrowser/completion/completiondelegate.py b/qutebrowser/completion/completiondelegate.py index cc5794a6c..d63658cc3 100644 --- a/qutebrowser/completion/completiondelegate.py +++ b/qutebrowser/completion/completiondelegate.py @@ -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.""" diff --git a/qutebrowser/completion/completionwidget.py b/qutebrowser/completion/completionwidget.py index da0a77157..24b59f622 100644 --- a/qutebrowser/completion/completionwidget.py +++ b/qutebrowser/completion/completionwidget.py @@ -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'] }}; } diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index d8f81bcd6..f8c7fb054 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -120,6 +120,7 @@ SECTION_DESC = { DEFAULT_FONT_SIZE = '10pt' if sys.platform == 'darwin' else '8pt' +orientation = 'bold' def data(readonly=False): @@ -414,7 +415,7 @@ def data(readonly=False): ('auto-open', SettingValue(typ.Bool(), 'true'), "Automatically open completion when typing."), - + ('download-path-suggestion', SettingValue( typ.String(valid_values=typ.ValidValues( @@ -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 )), @@ -1253,9 +1242,12 @@ def data(readonly=False): "Default monospace fonts."), ('completion', - SettingValue(typ.Font(), DEFAULT_FONT_SIZE + ' ${_monospace}'), + 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}'),