diff options
| author | Pietro Gagliardi <[email protected]> | 2014-10-26 20:08:53 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-10-26 20:08:53 -0400 |
| commit | d97f5233a94b0a7759a3889e157f89646d7ea3c8 (patch) | |
| tree | ded2be911e0dfbb762e54939f435df13794cf24d | |
| parent | 3f39288a393620f5bbf0a50a65bfe96f12dcbada (diff) | |
De-container-ized Stack.
| -rw-r--r-- | stack.go | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -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 |
