Use less contrasting color for powerline alt separator

This change makes it so that when using powerline-style tab bars, and
if the `tab_bar_background`, `inactive_tab_background` and
`inactive_tab_foreground` are all different, the separator between
inactive tabs uses the less contrasting color between the inactive
foreground, and the tab bar background.

This fixes #3664.
This commit is contained in:
John R. Lenton
2021-05-29 16:54:51 +01:00
parent 39b3d3de0f
commit 97181a39da
2 changed files with 19 additions and 0 deletions

View File

@@ -234,6 +234,15 @@ def draw_tab_with_powerline(draw_data: DrawData, screen: Screen, tab: TabBarData
screen.cursor.bg = inactive_bg
screen.draw(separator_symbol)
else:
if tab_bg == default_bg:
pass
elif tab_bg == tab_fg:
screen.cursor.fg = default_bg
else:
c1 = draw_data.inactive_bg.contrast(draw_data.default_bg)
c2 = draw_data.inactive_bg.contrast(draw_data.inactive_fg)
if c1 < c2:
screen.cursor.fg = default_bg
screen.draw(f' {separator_alt_symbol}')
end = screen.cursor.x