Add configuration options for prompts

This commit is contained in:
Florian Bruhin 2016-10-26 20:38:03 +02:00
parent a33333eb41
commit 7d57d884d6
5 changed files with 47 additions and 30 deletions

View File

@ -54,6 +54,7 @@
|<<ui-modal-js-dialog,modal-js-dialog>>|Use standard JavaScript modal dialog for alert() and confirm()
|<<ui-hide-wayland-decoration,hide-wayland-decoration>>|Hide the window decoration when using wayland (requires restart)
|<<ui-keyhint-blacklist,keyhint-blacklist>>|Keychains that shouldn't be shown in the keyhint dialog
|<<ui-prompt-radius,prompt-radius>>|The rounding radius for the edges of prompts.
|==============
.Quick reference for section ``network''
@ -213,8 +214,6 @@
|<<colors-completion.scrollbar.bg,completion.scrollbar.bg>>|Color of the scrollbar in completion view
|<<colors-statusbar.fg,statusbar.fg>>|Foreground color of the statusbar.
|<<colors-statusbar.bg,statusbar.bg>>|Background color of the statusbar.
|<<colors-statusbar.fg.prompt,statusbar.fg.prompt>>|Foreground color of the statusbar if there is a prompt.
|<<colors-statusbar.bg.prompt,statusbar.bg.prompt>>|Background color of the statusbar if there is a prompt.
|<<colors-statusbar.fg.insert,statusbar.fg.insert>>|Foreground color of the statusbar in insert mode.
|<<colors-statusbar.bg.insert,statusbar.bg.insert>>|Background color of the statusbar in insert mode.
|<<colors-statusbar.fg.command,statusbar.fg.command>>|Foreground color of the statusbar in command mode.
@ -268,6 +267,8 @@
|<<colors-messages.fg.info,messages.fg.info>>|Foreground color an info message.
|<<colors-messages.bg.info,messages.bg.info>>|Background color of an info message.
|<<colors-messages.border.info,messages.border.info>>|Border color of an info message.
|<<colors-prompts.fg,prompts.fg>>|Foreground color for prompts.
|<<colors-prompts.bg,prompts.bg>>|Background color for prompts.
|==============
.Quick reference for section ``fonts''
@ -296,6 +297,7 @@
|<<fonts-messages.error,messages.error>>|Font used for error messages.
|<<fonts-messages.warning,messages.warning>>|Font used for warning messages.
|<<fonts-messages.info,messages.info>>|Font used for info messages.
|<<fonts-prompts,prompts>>|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]+

View File

@ -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'),

View File

@ -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
)),
])

View File

@ -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()

View File

@ -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"],