Add a new option tab_bar_background to specify a different color for the tab bar

Fixes #2198
This commit is contained in:
Kovid Goyal 2019-12-17 20:08:33 +05:30
parent b92f95b092
commit f59afff1d1
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 8 additions and 2 deletions

View File

@ -16,6 +16,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- Fix :opt:`background_opacity` incorrectly applying to selected text and
reverse video text (:iss:`2177`)
- Add a new option :opt:`tab_bar_background` to specify a different color
for the tab bar (:iss:`2198`)
0.15.0 [2019-11-27]
--------------------

View File

@ -730,6 +730,7 @@ o('active_tab_font_style', 'bold-italic', option_type=tab_font_style)
o('inactive_tab_foreground', '#444', option_type=to_color)
o('inactive_tab_background', '#999', option_type=to_color)
o('inactive_tab_font_style', 'normal', option_type=tab_font_style)
o('tab_bar_background', 'none', option_type=to_color_or_none)
# }}}

View File

@ -177,7 +177,7 @@ class TabBar:
self.leading_spaces, self.sep, self.trailing_spaces, self.opts.bell_on_tab, self.bell_fg,
self.opts.tab_fade, self.opts.active_tab_foreground, self.opts.active_tab_background,
self.opts.inactive_tab_foreground, self.opts.inactive_tab_background,
self.opts.background, self.opts.tab_title_template
self.opts.tab_bar_background or self.opts.background, self.opts.tab_title_template
)
if self.opts.tab_bar_style == 'separator':
self.draw_func = draw_tab_with_separator
@ -194,7 +194,9 @@ class TabBar:
self.draw_data = self.draw_data._replace(active_bg=color_from_int(spec['active_tab_background']))
if 'inactive_tab_background' in spec:
self.draw_data = self.draw_data._replace(inactive_bg=color_from_int(spec['inactive_tab_background']))
if 'background' in spec:
if 'tab_bar_background' in spec:
self.draw_data = self.draw_data._replace(default_bg=color_from_int(spec['tab_bar_background']))
elif 'background' in spec and not self.opts.tab_bar_background:
self.draw_data = self.draw_data._replace(default_bg=color_from_int(spec['background']))
self.screen.color_profile.set_configured_colors(
spec.get('inactive_tab_foreground', color_as_int(self.opts.inactive_tab_foreground)),