diff --git a/absolute_layout.go b/absolute_layout.go index a9af254..4b52853 100644 --- a/absolute_layout.go +++ b/absolute_layout.go @@ -112,7 +112,7 @@ func (w *AbsoluteLayout) Draw(screen tcell.Screen) { a = w.defAnchor } midX := (w.x + (w.x + w.w)) / 2 - midY := (w.y + (w.y + w.h)) / 2 + // midY := (w.y + (w.y + w.h)) / 2 switch a { case AnchorTL: w.widgets[i].SetPos(p.Add(Coord{X: w.x, Y: w.y})) diff --git a/cli.go b/cli.go index 3510728..c85114d 100644 --- a/cli.go +++ b/cli.go @@ -62,6 +62,7 @@ func NewCli(id string, s tcell.Style) *Cli { func (w *Cli) Init(id string, s tcell.Style) { w.id, w.style = id, s + w.visible = true } func (w *Cli) Id() string { return w.id } @@ -179,7 +180,7 @@ func (w *Cli) Draw(screen tcell.Screen) { } dStyle := w.style if !w.active { - w.style = dStyle.Dim(true) + dStyle = dStyle.Dim(true) } h.Border(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 @@ -189,7 +190,7 @@ func (w *Cli) Draw(screen tcell.Screen) { if len(line) > w.w-2 { line = line[:w.w-2] } - h.DrawText(x, y, line, dStyle, screen) + h.DrawText(x, y, h.PadR(line, w.w), dStyle, screen) y-- } } @@ -208,7 +209,7 @@ func (w *Cli) Draw(screen tcell.Screen) { x += len(pre) h.DrawText(x, y, cursor, dStyle.Reverse(w.active), screen) x += 1 - h.DrawText(x, y, post, dStyle, screen) + h.DrawText(x, y, h.PadR(post, w.w-x), dStyle, screen) // x += len(post) - 1 }