From a03c4ae34553eadcd58f3f117c6e38d124f13ab9 Mon Sep 17 00:00:00 2001 From: Brian Buller Date: Thu, 3 Jul 2025 11:53:38 -0500 Subject: [PATCH] CLI Work --- cli.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cli.go b/cli.go index c85114d..28ff716 100644 --- a/cli.go +++ b/cli.go @@ -39,6 +39,7 @@ type Cli struct { active bool visible bool + title string rawLog []string log []string logPosition int @@ -182,7 +183,12 @@ func (w *Cli) Draw(screen tcell.Screen) { if !w.active { dStyle = dStyle.Dim(true) } - h.Border(w.x, w.y, w.x+w.w-1, w.y+w.h, h.BRD_SIMPLE, dStyle, screen) + if w.title != "" { + h.TitledBorderFilled(w.x, w.y, w.x+w.w-1, w.y+w.h, w.title, h.BRD_SIMPLE, dStyle, screen) + } else { + h.BorderFilled(w.x, w.y, w.x+w.w-1, w.y+w.h, h.BRD_SIMPLE, dStyle, screen) + } + x, y := w.x+1, w.y+1+w.h-3 for i := 0; i < w.h-2; i++ { if len(w.log) > i { @@ -231,6 +237,8 @@ func (w *Cli) SetSize(c Coord) { w.w, w.h = c.X, c.Y } func (w *Cli) WantW() int { return w.w } func (w *Cli) WantH() int { return w.h } +func (w *Cli) SetTitle(ttl string) { w.title = ttl } +func (w *Cli) Title() string { return w.title } func (w *Cli) SetValue(val string) { w.value = val w.cursor = len(val)