Really figuring some things out
This commit is contained in:
@@ -29,6 +29,7 @@ import (
|
||||
"github.com/gdamore/tcell"
|
||||
)
|
||||
|
||||
// TODO: Rebuild with LinearLayouts
|
||||
type Prompt struct {
|
||||
id string
|
||||
style tcell.Style
|
||||
@@ -67,6 +68,11 @@ func (w *Prompt) Init(id string, style tcell.Style) {
|
||||
}
|
||||
func (w *Prompt) Id() string { return w.id }
|
||||
func (w *Prompt) HandleResize(ev *tcell.EventResize) {
|
||||
w.w, w.h = ev.Size()
|
||||
|
||||
w.w = wh.Min(w.w, w.WantW())
|
||||
w.h = wh.Min(w.h, w.WantH())
|
||||
|
||||
w.message.SetPos(Coord{X: w.x + 1, Y: w.y + 1})
|
||||
w.field.SetPos(Coord{X: w.x + 1, Y: WidgetBottom(w.message)})
|
||||
w.btnOk.SetPos(Coord{X: w.x + w.w - w.btnOk.WantW(), Y: w.y + w.h - 1})
|
||||
|
||||
Reference in New Issue
Block a user