From e13a5c0f17cf6916a7e4d86adf992e917a132e03 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 15 May 2017 11:00:11 +0200 Subject: [PATCH] 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. --- qutebrowser/mainwindow/statusbar/bar.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/qutebrowser/mainwindow/statusbar/bar.py b/qutebrowser/mainwindow/statusbar/bar.py index c05dbcb25..af026ff0b 100644 --- a/qutebrowser/mainwindow/statusbar/bar.py +++ b/qutebrowser/mainwindow/statusbar/bar.py @@ -80,15 +80,15 @@ class ColorFlags: def _generate_stylesheet(): - flags = { - 'private': 'statusbar.{}.private', - 'caret': 'statusbar.{}.caret', - 'caret-selection': 'statusbar.{}.caret-selection', - 'prompt': 'prompts.{}', - 'insert': 'statusbar.{}.insert', - 'command': 'statusbar.{}.command', - 'private-command': 'statusbar.{}.command.private', - } + flags = [ + ('private', 'statusbar.{}.private'), + ('caret', 'statusbar.{}.caret'), + ('caret-selection', 'statusbar.{}.caret-selection'), + ('prompt', 'prompts.{}'), + ('insert', 'statusbar.{}.insert'), + ('command', 'statusbar.{}.command'), + ('private-command', 'statusbar.{}.command.private'), + ] stylesheet = """ QWidget#StatusBar, QWidget#StatusBar QLabel, @@ -98,7 +98,7 @@ def _generate_stylesheet(): color: {{ color['statusbar.fg'] }}; } """ - for flag, option in sorted(flags.items()): + for flag, option in flags: stylesheet += """ QWidget#StatusBar[color_flags~="%s"], QWidget#StatusBar[color_flags~="%s"] QLabel,