tui/tmpl_view.go
2023-04-24 11:41:38 +02:00

28 lines
400 B
Go

package tui
type ViewTmpl struct {
EventTmpl
style *Style
}
var _ View = &ViewTmpl{}
func (v *ViewTmpl) Draw(buf *ViewBuffer) {
buf.Fill(Rune{' ', v.Style()})
}
func (v *ViewTmpl) Layout() (prefWidth, prefHeight int) {
return -1, -1
}
func (v *ViewTmpl) SetStyle(s Style) {
v.style = &s
}
func (v *ViewTmpl) Style() Style {
if v.style == nil {
return StyleDefault
}
return *v.style
}