diff --git a/container/container_test.go b/container/container_test.go index 26a1917..1fcb2a9 100644 --- a/container/container_test.go +++ b/container/container_test.go @@ -1003,7 +1003,7 @@ func TestNew(t *testing.T) { return ft }, }, - { + { desc: "sets border title on root container of different color", termSize: image.Point{10, 10}, container: func(ft *faketerm.Terminal) (*Container, error) { @@ -1065,9 +1065,9 @@ func TestNew(t *testing.T) { SplitVertical( Left( Border(linestyle.Light), - BorderTitle("Ab"), - TitleColor(cell.ColorMagenta), - TitleFocusedColor(cell.ColorCyan), + BorderTitle("Ab"), + TitleColor(cell.ColorMagenta), + TitleFocusedColor(cell.ColorCyan), ), Right( Border(linestyle.Light), @@ -1103,7 +1103,6 @@ func TestNew(t *testing.T) { return ft }, }, - { desc: "inherits title color on left child container", termSize: image.Point{10, 10}, @@ -1116,7 +1115,7 @@ func TestNew(t *testing.T) { SplitVertical( Left( Border(linestyle.Light), - BorderTitle("Ab"), + BorderTitle("Ab"), ), Right( Border(linestyle.Light), diff --git a/container/draw.go b/container/draw.go index 83524b3..9368f2d 100644 --- a/container/draw.go +++ b/container/draw.go @@ -87,19 +87,19 @@ func drawBorder(c *Container) error { var cOpts, titleCOpts []cell.Option if c.focusTracker.isActive(c) { cOpts = append(cOpts, cell.FgColor(c.opts.inherited.focusedColor)) - if c.opts.inherited.titleFocusedColor != nil { + if c.opts.inherited.titleFocusedColor != nil { titleCOpts = append(titleCOpts, cell.FgColor(*c.opts.inherited.titleFocusedColor)) - } else { + } else { titleCOpts = cOpts } - } else { + } else { cOpts = append(cOpts, cell.FgColor(c.opts.inherited.borderColor)) - if c.opts.inherited.titleColor != nil { + if c.opts.inherited.titleColor != nil { titleCOpts = append(titleCOpts, cell.FgColor(*c.opts.inherited.titleColor)) - } else { + } else { titleCOpts = cOpts } - } + } if err := draw.Border(cvs, ar, draw.BorderLineStyle(c.opts.border),