diff --git a/views/view_border.go b/views/view_border.go index 8f8611a..e4dcbae 100644 --- a/views/view_border.go +++ b/views/view_border.go @@ -7,7 +7,8 @@ import "git.tordarus.net/Tordarus/tui" // This can lead to color artifacts when using BorderView with colored styles. type BorderView struct { tui.WrapperTmpl - Border BorderBox + Border BorderBox + HideBorder bool } var _ tui.Wrapper = &BorderView{} @@ -20,6 +21,11 @@ func NewBorderView(view tui.View) *BorderView { } func (g *BorderView) Draw(buf *tui.ViewBuffer) { + if g.HideBorder { + g.View().Draw(buf) + return + } + g.View().Draw(buf.Sub(1, 1, buf.Width()-2, buf.Height()-2)) buf.Set(0, 0, tui.Rune{Rn: g.Border.TopLeft, Style: g.Style()})