Use a list for stylesheet flags
If we simply use sorted() on a dict, we define insert before private-command, which means the statusbar isn't going to be green when in insert mode while private browsing.
This commit is contained in:
parent
3cdcc34d1d
commit
e13a5c0f17
@ -80,15 +80,15 @@ class ColorFlags:
|
|||||||
|
|
||||||
|
|
||||||
def _generate_stylesheet():
|
def _generate_stylesheet():
|
||||||
flags = {
|
flags = [
|
||||||
'private': 'statusbar.{}.private',
|
('private', 'statusbar.{}.private'),
|
||||||
'caret': 'statusbar.{}.caret',
|
('caret', 'statusbar.{}.caret'),
|
||||||
'caret-selection': 'statusbar.{}.caret-selection',
|
('caret-selection', 'statusbar.{}.caret-selection'),
|
||||||
'prompt': 'prompts.{}',
|
('prompt', 'prompts.{}'),
|
||||||
'insert': 'statusbar.{}.insert',
|
('insert', 'statusbar.{}.insert'),
|
||||||
'command': 'statusbar.{}.command',
|
('command', 'statusbar.{}.command'),
|
||||||
'private-command': 'statusbar.{}.command.private',
|
('private-command', 'statusbar.{}.command.private'),
|
||||||
}
|
]
|
||||||
stylesheet = """
|
stylesheet = """
|
||||||
QWidget#StatusBar,
|
QWidget#StatusBar,
|
||||||
QWidget#StatusBar QLabel,
|
QWidget#StatusBar QLabel,
|
||||||
@ -98,7 +98,7 @@ def _generate_stylesheet():
|
|||||||
color: {{ color['statusbar.fg'] }};
|
color: {{ color['statusbar.fg'] }};
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
for flag, option in sorted(flags.items()):
|
for flag, option in flags:
|
||||||
stylesheet += """
|
stylesheet += """
|
||||||
QWidget#StatusBar[color_flags~="%s"],
|
QWidget#StatusBar[color_flags~="%s"],
|
||||||
QWidget#StatusBar[color_flags~="%s"] QLabel,
|
QWidget#StatusBar[color_flags~="%s"] QLabel,
|
||||||
|
Loading…
Reference in New Issue
Block a user