aboutsummaryrefslogtreecommitdiffstats
path: root/layout/region.go
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2026-02-10 17:20:34 -0500
committerSam Anthony <sam@samanthony.xyz>2026-02-10 17:20:34 -0500
commitebc5d96f0614ab3b4f2073eadf22fbe554b0ec8f (patch)
tree625376cfc4b0ee82a02e340a2fe813882b6047c4 /layout/region.go
parent430f97bed9d758de90a72b0c06b2be1989ba2b1d (diff)
downloadgui-ebc5d96f0614ab3b4f2073eadf22fbe554b0ec8f.zip
remove layout options
Diffstat (limited to 'layout/region.go')
-rw-r--r--layout/region.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/layout/region.go b/layout/region.go
index 93d930a..1e4d4b1 100644
--- a/layout/region.go
+++ b/layout/region.go
@@ -2,6 +2,7 @@ package layout
import (
"image"
+ "image/color"
"image/draw"
"github.com/faiface/gui"
@@ -16,9 +17,7 @@ type Region struct {
// NewRegion creates a region layout that occupies part of the parent env's area, as determined by the resize function.
// Resize takes the area of the parent and returns the area of the region.
// It returns the child Env.
-func NewRegion(env gui.Env, resize func(image.Rectangle) image.Rectangle, o ...Option) gui.Env {
- opts := evalOptions(o...)
-
+func NewRegion(env gui.Env, clr color.Color, resize func(image.Rectangle) image.Rectangle) gui.Env {
events := make(chan gui.Event) // to child
drw := make(chan func(draw.Image) image.Rectangle) // from child
@@ -30,7 +29,7 @@ func NewRegion(env gui.Env, resize func(image.Rectangle) image.Rectangle, o ...O
// Draw background
redrawBg := func(area image.Rectangle) func(draw.Image) image.Rectangle {
- return drawSubImage(drawBackground(opts.bg), area)
+ return drawSubImage(drawBackground(clr), area)
}
env.Draw() <- redrawBg(area)