Hopefully making good choices
This commit is contained in:
@@ -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) }
|
||||
|
||||
Reference in New Issue
Block a user