From 1415586e633ee33194442f131a5a691f889c8ee5 Mon Sep 17 00:00:00 2001 From: Clement Benard Date: Tue, 9 Jul 2019 15:31:32 +0200 Subject: better Mux and Env handling in layout --- layout/box.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'layout/box.go') diff --git a/layout/box.go b/layout/box.go index 568ac58..4e16a76 100644 --- a/layout/box.go +++ b/layout/box.go @@ -33,7 +33,7 @@ type Box struct { vertical bool } -func NewBox(env gui.Env, contents []*gui.Env, options ...func(*Box)) { +func NewBox(env gui.Env, contents []*gui.Env, options ...func(*Box)) gui.Env { ret := &Box{ Background: image.Black, Contents: contents, @@ -43,10 +43,11 @@ func NewBox(env gui.Env, contents []*gui.Env, options ...func(*Box)) { f(ret) } - mux := NewMux(env, ret) + mux, env := NewMux(env, ret) for _, item := range contents { - *item, _ = mux.makeEnv(false) + *item = mux.MakeEnv() } + return env } func BoxVertical(b *Box) { -- cgit v1.2.3