align using a table
This commit is contained in:
parent
3cd252ef82
commit
acb60a1bf4
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user