Clean up html for keyhint text.
The \t was behaving the same as a space and the <b> was doing nothing.
This commit is contained in:
parent
8eee5def5d
commit
3cd252ef82
@ -107,9 +107,9 @@ class KeyHintView(QLabel):
|
||||
suffix = "<font color='{}'>{}</font>".format(suffix_color,
|
||||
html.escape(key[len(prefix):]))
|
||||
|
||||
text += '{}{}\t<b>{}</b><br>'.format(html.escape(prefix),
|
||||
suffix,
|
||||
html.escape(cmd))
|
||||
text += '{}{} {}<br>'.format(html.escape(prefix),
|
||||
suffix,
|
||||
html.escape(cmd))
|
||||
|
||||
self.setText(text)
|
||||
self.adjustSize()
|
||||
|
@ -60,7 +60,7 @@ class TestKeyHintView:
|
||||
('xe', 'cmd-xe')]))
|
||||
|
||||
keyhint.update_keyhint('normal', 'a')
|
||||
line = "a<font color='{}'>{}</font>\t<b>{}</b><br>"
|
||||
line = "a<font color='{}'>{}</font> {}<br>"
|
||||
assert keyhint.text() == (line.format('yellow', 'a', 'cmd-aa') +
|
||||
line.format('yellow', 'b', 'cmd-ab') +
|
||||
line.format('yellow', 'ba', 'cmd-aba') +
|
||||
@ -75,12 +75,12 @@ class TestKeyHintView:
|
||||
('<ctrl-a>', 'cmd-aba')]))
|
||||
|
||||
keyhint.update_keyhint('normal', '<')
|
||||
line = "<<font color='{}'>{}</font>\t<b>{}</b><br>"
|
||||
line = "<<font color='{}'>{}</font> {}<br>"
|
||||
assert keyhint.text() == (line.format('yellow', 'a', 'cmd-aa') +
|
||||
line.format('yellow', 'b', 'cmd-ab'))
|
||||
|
||||
def test_disable(self, qtbot, keyhint, config_stub):
|
||||
"""Ensure the a prefix of '<' doesn't suggest special keys"""
|
||||
"""Ensure the widget isn't visible if disabled."""
|
||||
config_stub.set('ui', 'show-keyhints', False)
|
||||
keyhint.update_keyhint('normal', 'a')
|
||||
assert not keyhint.text()
|
||||
@ -92,5 +92,5 @@ class TestKeyHintView:
|
||||
key_config_stub.set_bindings_for('normal', OrderedDict([
|
||||
('aa', 'cmd-aa')]))
|
||||
keyhint.update_keyhint('normal', 'a')
|
||||
expected = "a<font color='#ABCDEF'>a</font>\t<b>cmd-aa</b><br>"
|
||||
expected = "a<font color='#ABCDEF'>a</font> cmd-aa<br>"
|
||||
assert keyhint.text() == expected
|
||||
|
Loading…
Reference in New Issue
Block a user