20 lines
346 B
Go
20 lines
346 B
Go
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
|
|
}
|