tui/viewtmpl.go
Timon Ringwald dfa00f5fe3 more views
2022-04-02 13:01:41 +02:00

31 lines
473 B
Go

package tui
type ViewTmpl struct {
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) OnKeyPressed(event *KeyEvent) (consumed bool) {
return false
}
func (v *ViewTmpl) SetStyle(s Style) {
v.style = &s
}
func (v *ViewTmpl) Style() Style {
if v.style == nil {
return StyleDefault
}
return *v.style
}