Use default color for selected tab

This commit is contained in:
Drew DeVault 2018-06-07 13:43:17 -04:00
parent 28021ede1b
commit e463c38476

View file

@ -72,13 +72,19 @@ func (tabs *Tabs) Select(index int) {
func (strip *TabStrip) Draw(ctx *Context) {
x := 0
for i, tab := range strip.Tabs {
style := tcell.StyleDefault.Background(tcell.ColorWhite).Foreground(tcell.ColorBlack)
style := tcell.StyleDefault.
Background(tcell.ColorWhite).
Foreground(tcell.ColorBlack)
if strip.Selected == i {
style = style.Reverse(true)
style = tcell.StyleDefault.
Background(tcell.ColorDefault).
Foreground(tcell.ColorDefault)
}
x += ctx.Printf(x, 0, style, " %s ", tab.Name)
}
style := tcell.StyleDefault.Background(tcell.ColorWhite).Foreground(tcell.ColorBlack)
style := tcell.StyleDefault.
Background(tcell.ColorWhite).
Foreground(tcell.ColorBlack)
ctx.Fill(x, 0, ctx.Width()-x, 1, ' ', style)
}