tui/viewtmpl.go
2022-04-03 16:29:01 +02:00

35 lines
561 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) OnMouseClicked(event *MouseEvent) (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
}