Files
beatglow/ui/widget/base.go
T
2026-10-29 17:29:41 +01:00

33 lines
568 B
Go

package widget
import (
"image"
"image/draw"
"github.com/BeatGlow/beatglow/ui"
"github.com/BeatGlow/display"
)
type base struct {
display display.Display
style ui.Style
position image.Point
buffer draw.Image
changed bool
}
func makeBase(display display.Display, at image.Point, width, height int) base {
m := display.ColorModel()
return base{
display: display,
style: ui.StylesFor(m).Default,
position: at,
buffer: ui.BufferFor(m, width, height),
}
}
func (w *base) SetStyle(style ui.Style) {
w.style = style
w.changed = true
}