From 7d57d884d68eb59f4979bb3791570dd5ba10cb92 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 26 Oct 2016 20:38:03 +0200 Subject: [PATCH] Add configuration options for prompts --- doc/help/settings.asciidoc | 42 ++++++++++++++++--------- qutebrowser/config/config.py | 2 ++ qutebrowser/config/configdata.py | 20 +++++++----- qutebrowser/mainwindow/prompt.py | 9 ++---- qutebrowser/mainwindow/statusbar/bar.py | 4 +-- 5 files changed, 47 insertions(+), 30 deletions(-) diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 8a25e2b31..069376be4 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -54,6 +54,7 @@ |<>|Use standard JavaScript modal dialog for alert() and confirm() |<>|Hide the window decoration when using wayland (requires restart) |<>|Keychains that shouldn't be shown in the keyhint dialog +|<>|The rounding radius for the edges of prompts. |============== .Quick reference for section ``network'' @@ -213,8 +214,6 @@ |<>|Color of the scrollbar in completion view |<>|Foreground color of the statusbar. |<>|Background color of the statusbar. -|<>|Foreground color of the statusbar if there is a prompt. -|<>|Background color of the statusbar if there is a prompt. |<>|Foreground color of the statusbar in insert mode. |<>|Background color of the statusbar in insert mode. |<>|Foreground color of the statusbar in command mode. @@ -268,6 +267,8 @@ |<>|Foreground color an info message. |<>|Background color of an info message. |<>|Border color of an info message. +|<>|Foreground color for prompts. +|<>|Background color for prompts. |============== .Quick reference for section ``fonts'' @@ -296,6 +297,7 @@ |<>|Font used for error messages. |<>|Font used for warning messages. |<>|Font used for info messages. +|<>|Font used for prompts. |============== == general @@ -706,6 +708,12 @@ Globs are supported, so ';*' will blacklist all keychainsstarting with ';'. Use Default: empty +[[ui-prompt-radius]] +=== prompt-radius +The rounding radius for the edges of prompts. + +Default: +pass:[8]+ + == network Settings related to the network. @@ -1831,18 +1839,6 @@ Background color of the statusbar. Default: +pass:[black]+ -[[colors-statusbar.fg.prompt]] -=== statusbar.fg.prompt -Foreground color of the statusbar if there is a prompt. - -Default: +pass:[${statusbar.fg}]+ - -[[colors-statusbar.bg.prompt]] -=== statusbar.bg.prompt -Background color of the statusbar if there is a prompt. - -Default: +pass:[darkblue]+ - [[colors-statusbar.fg.insert]] === statusbar.fg.insert Foreground color of the statusbar in insert mode. @@ -2184,6 +2180,18 @@ Border color of an info message. Default: +pass:[#333333]+ +[[colors-prompts.fg]] +=== prompts.fg +Foreground color for prompts. + +Default: +pass:[white]+ + +[[colors-prompts.bg]] +=== prompts.bg +Background color for prompts. + +Default: +pass:[darkblue]+ + == fonts Fonts used for the UI, with optional style/weight/size. @@ -2322,3 +2330,9 @@ Default: +pass:[8pt ${_monospace}]+ Font used for info messages. Default: +pass:[8pt ${_monospace}]+ + +[[fonts-prompts]] +=== prompts +Font used for prompts. + +Default: +pass:[8pt sans-serif]+ diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index 8ee27918a..7c8ba98c5 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -391,6 +391,8 @@ class ConfigManager(QObject): ('colors', 'statusbar.bg.error'): 'messages.bg.error', ('colors', 'statusbar.fg.warning'): 'messages.fg.warning', ('colors', 'statusbar.bg.warning'): 'messages.bg.warning', + ('colors', 'statusbar.fg.prompt'): 'prompts.fg', + ('colors', 'statusbar.bg.prompt'): 'prompts.bg', } DELETED_OPTIONS = [ ('colors', 'tab.separator'), diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index bad9433f1..b97a8316a 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -1079,14 +1079,6 @@ def data(readonly=False): SettingValue(typ.QssColor(), 'black'), "Background color of the statusbar."), - ('statusbar.fg.prompt', - SettingValue(typ.QssColor(), '${statusbar.fg}'), - "Foreground color of the statusbar if there is a prompt."), - - ('statusbar.bg.prompt', - SettingValue(typ.QssColor(), 'darkblue'), - "Background color of the statusbar if there is a prompt."), - ('statusbar.fg.insert', SettingValue(typ.QssColor(), '${statusbar.fg}'), "Foreground color of the statusbar in insert mode."), @@ -1310,6 +1302,14 @@ def data(readonly=False): SettingValue(typ.QssColor(), '#333333'), "Border color of an info message."), + ('prompts.fg', + SettingValue(typ.QssColor(), 'white'), + "Foreground color for prompts."), + + ('prompts.bg', + SettingValue(typ.QssColor(), 'darkblue'), + "Background color for prompts."), + readonly=readonly )), @@ -1411,6 +1411,10 @@ def data(readonly=False): SettingValue(typ.Font(), DEFAULT_FONT_SIZE + ' ${_monospace}'), "Font used for info messages."), + ('prompts', + SettingValue(typ.Font(), DEFAULT_FONT_SIZE + ' sans-serif'), + "Font used for prompts."), + readonly=readonly )), ]) diff --git a/qutebrowser/mainwindow/prompt.py b/qutebrowser/mainwindow/prompt.py index 4d7430e14..6be7eb633 100644 --- a/qutebrowser/mainwindow/prompt.py +++ b/qutebrowser/mainwindow/prompt.py @@ -92,12 +92,9 @@ class PromptContainer(QWidget): } QWidget { - /* FIXME - font: {{ font['keyhint'] }}; - FIXME - */ - color: {{ color['statusbar.fg.prompt'] }}; - background-color: {{ color['statusbar.bg.prompt'] }}; + font: {{ font['prompts'] }}; + color: {{ color['prompts.fg'] }}; + background-color: {{ color['prompts.bg'] }}; } """ update_geometry = pyqtSignal() diff --git a/qutebrowser/mainwindow/statusbar/bar.py b/qutebrowser/mainwindow/statusbar/bar.py index cca640c93..21e0d46ea 100644 --- a/qutebrowser/mainwindow/statusbar/bar.py +++ b/qutebrowser/mainwindow/statusbar/bar.py @@ -112,8 +112,8 @@ class StatusBar(QWidget): QWidget#StatusBar[prompt_active="true"], QWidget#StatusBar[prompt_active="true"] QLabel, QWidget#StatusBar[prompt_active="true"] QLineEdit { - color: {{ color['statusbar.fg.prompt'] }}; - background-color: {{ color['statusbar.bg.prompt'] }}; + color: {{ color['prompts.fg'] }}; + background-color: {{ color['prompts.bg'] }}; } QWidget#StatusBar[insert_active="true"],