More work

This commit is contained in:
2026-02-18 19:08:29 -06:00
parent 009d5701d2
commit 4066197ec1
3 changed files with 57 additions and 21 deletions

View File

@@ -167,7 +167,10 @@ func (w *JsonContent) Draw(screen tcell.Screen) {
if w.editable {
var key, val string
pts := strings.Split(txt, ":")
if len(pts) == 2 {
key, val = pts[0], pts[1]
}
wh.DrawText(w.x, y, key, st.Dim(dim).Bold(!dim), screen)
st = st.Reverse(true)
wh.DrawText(w.x, y, val, st.Dim(dim).Bold(!dim), screen)

View File

@@ -40,6 +40,8 @@ type TreeBrowser struct {
searching bool
searchStr string
hintText string
logger func(string, ...any)
m sync.Mutex
@@ -160,6 +162,13 @@ func (w *TreeBrowser) Draw(screen tcell.Screen) {
th.BorderFilled(x, y, x+w.w, y+w.h, w.border, dS, screen)
}
}
if w.hintText != "" {
if brdSz == 0 {
brdSz = 1
}
wh.DrawText(x+1, y+w.h, w.hintText, dS, screen)
}
x, y = x+1, y+1
h := w.h - brdSz
ln := len(w.list)
@@ -487,6 +496,9 @@ func (w *TreeBrowser) getCurrentLine() string {
return w.list[w.cursor]
}
func (w *TreeBrowser) SetHintText(txt string) { w.hintText = txt }
func (w *TreeBrowser) ClearHintText(txt string) { w.hintText = "" }
/*
* Tree Node
*/