This commit is contained in:
2025-07-03 11:53:38 -05:00
parent c871bc9ad2
commit a03c4ae345

10
cli.go
View File

@@ -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)