Hopefully making good choices

This commit is contained in:
2025-10-29 16:54:38 -05:00
parent 8f6e52df41
commit 250e33f8e2
6 changed files with 494 additions and 10 deletions

View File

@@ -41,6 +41,8 @@ type Text struct {
active bool
focusable bool
keyMap *KeyMap
flags LayoutFlag
}
var _ Widget = (*Text)(nil)
@@ -73,7 +75,9 @@ func (w *Text) Draw(screen tcell.Screen) {
}
y := w.y
for i := range w.message {
wh.DrawText(w.x+(w.w/2)-(len(w.message[i])/2), y, w.message[i], w.style, screen)
// wh.DrawText(w.x+(w.w/2)-(len(w.message[i])/2), y, w.message[i], w.style, screen)
wh.DrawText(w.x, y, w.message[i], w.style, screen)
// wh.DrawText(w.x+w.w-(len(w.message[i])), y, w.message[i], w.style, screen)
y++
}
}
@@ -111,3 +115,6 @@ func (w *Text) SetText(txt string) {
func (w *Text) GetText() string { return w.text }
func (w *Text) GetMessage() []string { return w.message }
func (w *Text) AddFlag(f LayoutFlag) { w.flags.Add(f) }
func (w *Text) RemoveFlag(f LayoutFlag) { w.flags.Remove(f) }