diff options
| author | Pietro Gagliardi <[email protected]> | 2014-10-02 10:05:53 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-10-02 10:05:53 -0400 |
| commit | 982004d05052ef6aadd22dd5c4e7dbca85ab324a (patch) | |
| tree | 517a0f5a5397e6fb886b5e4741aff4fa18ba10d8 /container.go | |
| parent | 09db0bffffded1a68c562b2d6451c2a2b29ac279 (diff) | |
go fmt. Precursor to bug report filing.
Diffstat (limited to 'container.go')
| -rw-r--r-- | container.go | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/container.go b/container.go index c855072..143985c 100644 --- a/container.go +++ b/container.go @@ -3,20 +3,20 @@ package ui type allocation struct { - x int - y int - width int - height int - this Control - neighbor Control + x int + y int + width int + height int + this Control + neighbor Control } type sizingbase struct { - xmargin int - ymargintop int - ymarginbottom int - xpadding int - ypadding int + xmargin int + ymargintop int + ymarginbottom int + xpadding int + ypadding int } type controlSizing interface { @@ -31,19 +31,19 @@ type controlSizing interface { // Tab and Group use containers for their content; as such, their commitResize() functions should only change the size of the Tab and Group themselves, and have their containers do the real work. // All containers must embed containerbase. type containerbase struct { - child Control + child Control } // set to true to apply spacing to all windows var spaced bool = false func (c *container) resize(x, y, width, height int) { - if c.child == nil { // no children; nothing to do + if c.child == nil { // no children; nothing to do return } d := c.beginResize() - allocations := c.child.allocate(x + d.xmargin, y + d.ymargintop, - width - (2 * d.xmargin), height - d.ymargintop - d.ymarginbottom, d) + allocations := c.child.allocate(x+d.xmargin, y+d.ymargintop, + width-(2*d.xmargin), height-d.ymargintop-d.ymarginbottom, d) c.translateAllocationCoords(allocations, width, height) // move in reverse so as to approximate right->left order so neighbors make sense for i := len(allocations) - 1; i >= 0; i-- { |
