From 212d5fe932137da5e2961421e506f1206867f665 Mon Sep 17 00:00:00 2001 From: nanjekyejoannah Date: Mon, 1 Aug 2016 11:28:27 +0300 Subject: [PATCH 1/5] commit resolving issue #1395 --- qutebrowser/completion/completiondelegate.py | 2 +- qutebrowser/completion/completionwidget.py | 2 ++ qutebrowser/config/configdata.py | 13 +++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/qutebrowser/completion/completiondelegate.py b/qutebrowser/completion/completiondelegate.py index ab7b3ad88..cc5794a6c 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('{}'.format(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 80e87dbe4..da0a77157 100644 --- a/qutebrowser/completion/completionwidget.py +++ b/qutebrowser/completion/completionwidget.py @@ -69,6 +69,8 @@ class CompletionView(QTreeView): {{ color['completion.category.border.top'] }}; border-bottom: 1px solid {{ color['completion.category.border.bottom'] }}; + font: {{ config.get('completion', 'bold') }}; + } QTreeView::item:selected, QTreeView::item:selected:hover { diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 5110a6090..d8f81bcd6 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -466,6 +466,18 @@ 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 )), @@ -1244,6 +1256,7 @@ def data(readonly=False): SettingValue(typ.Font(), DEFAULT_FONT_SIZE + ' ${_monospace}'), "Font used in the completion widget."), + ('tabbar', SettingValue(typ.QtFont(), DEFAULT_FONT_SIZE + ' ${_monospace}'), "Font used in the tab bar."), From 1e946856537e8b5a9cc6a00504aebeeb710f6017 Mon Sep 17 00:00:00 2001 From: nanjekyejoannah Date: Mon, 1 Aug 2016 14:00:30 +0300 Subject: [PATCH 2/5] 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}'), From 633c95bca67a3aed029874c40fca77e9c302e963 Mon Sep 17 00:00:00 2001 From: nanjekyejoannah Date: Mon, 1 Aug 2016 14:14:15 +0300 Subject: [PATCH 3/5] resolving style things in commit resolving issue #1395 --- qutebrowser/config/configdata.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index f8c7fb054..5855a273f 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -120,7 +120,7 @@ SECTION_DESC = { DEFAULT_FONT_SIZE = '10pt' if sys.platform == 'darwin' else '8pt' -orientation = 'bold' + def data(readonly=False): @@ -415,7 +415,6 @@ 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( From 4d3cbe659d7df4edf5382150f3a31c8a18991384 Mon Sep 17 00:00:00 2001 From: nanjekyejoannah Date: Mon, 1 Aug 2016 14:30:20 +0300 Subject: [PATCH 4/5] refactor for configdatap.py resolving #1395 --- qutebrowser/config/configdata.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 5855a273f..744398dce 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -415,6 +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( @@ -1245,8 +1246,8 @@ def data(readonly=False): "Font used in the completion widget."), ('completion.category', - SettingValue(typ.Font(), 'bold' + '${completion}'), - "Font used in the completion fonts."), + SettingValue(typ.Font(), 'bold ${completion}'), + "Font used in the completion categories."), ('tabbar', SettingValue(typ.QtFont(), DEFAULT_FONT_SIZE + ' ${_monospace}'), From 3d4e76b1a4febd8865fe50008b3996f75d4d121a Mon Sep 17 00:00:00 2001 From: nanjekyejoannah Date: Mon, 1 Aug 2016 15:20:44 +0300 Subject: [PATCH 5/5] commit resolving issue#1395 --- qutebrowser/completion/completionwidget.py | 1 - qutebrowser/config/configdata.py | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/qutebrowser/completion/completionwidget.py b/qutebrowser/completion/completionwidget.py index 24b59f622..1ac49f28a 100644 --- a/qutebrowser/completion/completionwidget.py +++ b/qutebrowser/completion/completionwidget.py @@ -70,7 +70,6 @@ class CompletionView(QTreeView): border-bottom: 1px solid {{ color['completion.category.border.bottom'] }}; font: {{ font['completion.category'] }}; - } QTreeView::item:selected, QTreeView::item:selected:hover { diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 744398dce..caf1978a5 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -122,7 +122,6 @@ SECTION_DESC = { DEFAULT_FONT_SIZE = '10pt' if sys.platform == 'darwin' else '8pt' - def data(readonly=False): """Get the default config data. @@ -1242,10 +1241,10 @@ 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', + + ('completion.category', SettingValue(typ.Font(), 'bold ${completion}'), "Font used in the completion categories."), @@ -1592,7 +1591,8 @@ KEY_DATA = collections.OrderedDict([ ('rl-unix-line-discard', ['']), ('rl-kill-line', ['']), ('rl-kill-word', ['']), - ('rl-unix-word-rubout', ['', '']), + ('rl-unix-word-rubout', ['']), + ('rl-backward-kill-word', ['']), ('rl-yank', ['']), ('rl-delete-char', ['']), ('rl-backward-delete-char', ['']),