gui/tmpl_view.go

20 lines
346 B
Go
Raw Normal View History

2023-01-22 12:38:03 +01:00
package gui
type ViewTmpl struct {
EventTmpl
StyleTmpl
}
var _ View = &ViewTmpl{}
func (v *ViewTmpl) Draw(img *Image, ctx AppContext) {
bg := v.Background(ctx)
if _, _, _, a := bg.RGBA(); a > 0 {
img.DrawRect(img.Bounds(), v.Background(ctx))
}
}
func (v *ViewTmpl) Layout(ctx AppContext) (prefWidth, prefHeight int) {
return -1, -1
}