tui/viewtmpl.go
2022-05-04 14:16:08 +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
}