From d97f5233a94b0a7759a3889e157f89646d7ea3c8 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 26 Oct 2014 20:08:53 -0400 Subject: De-container-ized Stack. --- stack.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'stack.go') diff --git a/stack.go b/stack.go index 6b028a6..aeeb7ac 100644 --- a/stack.go +++ b/stack.go @@ -36,7 +36,6 @@ type stack struct { controls []Control stretchy []bool width, height []int // caches to avoid reallocating these each time - container *container padded bool } @@ -47,11 +46,6 @@ func newStack(o orientation, controls ...Control) Stack { stretchy: make([]bool, len(controls)), width: make([]int, len(controls)), height: make([]int, len(controls)), - container: newContainer(), - } - p := s.container.parent() - for _, c := range s.controls { - c.setParent(p) } return s } @@ -82,7 +76,9 @@ func (s *stack) SetPadded(padded bool) { } func (s *stack) setParent(parent *controlParent) { - s.container.setParent(parent) + for _, c := range s.controls { + c.setParent(parent) + } } func (s *stack) containerShow() { @@ -100,11 +96,9 @@ func (s *stack) containerHide() { func (s *stack) resize(x int, y int, width int, height int, d *sizing) { var stretchywid, stretchyht int - s.container.resize(x, y, width, height, d) if len(s.controls) == 0 { // do nothing if there's nothing to do return } - x, y, width, height = s.container.bounds(d) // -1) get this Stack's padding xpadding := d.xpadding ypadding := d.ypadding -- cgit v1.2.3