align using a table

This commit is contained in:
Felix Van der Jeugt 2016-05-16 11:38:39 +02:00 committed by Ryan Roden-Corrent
parent 3cd252ef82
commit acb60a1bf4

View File

@ -104,12 +104,19 @@ class KeyHintView(QLabel):
# for now, special keys can't be part of keychains, so ignore them # for now, special keys can't be part of keychains, so ignore them
is_special_binding = key.startswith('<') and key.endswith('>') is_special_binding = key.startswith('<') and key.endswith('>')
if key.startswith(prefix) and not is_special_binding: if key.startswith(prefix) and not is_special_binding:
suffix = "<font color='{}'>{}</font>".format(suffix_color, text += (
html.escape(key[len(prefix):])) "<tr>"
"<td>{}</td>"
text += '{}{} {}<br>'.format(html.escape(prefix), "<td style='color: {}'>{}</td>"
suffix, "<td style='padding-left: 2ex'>{}</td>"
html.escape(cmd)) "</tr>"
).format(
html.escape(prefix),
suffix_color,
html.escape(key[len(prefix):]),
html.escape(cmd)
)
text = '<table>{}</table>'.format(text)
self.setText(text) self.setText(text)
self.adjustSize() self.adjustSize()