diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-28 14:00:01 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-28 14:00:01 -0400 |
| commit | bea4df1abf6f4df34016727a300e4826fc31cc05 (patch) | |
| tree | 7f481ac4a25f72a72e549e26a5d44f87891e0a84 /redo/sizing.go | |
| parent | 3f124a016ea9d88db3c7b368b836fc296d1475e2 (diff) | |
Began final simplification of size code. spaced is now a global variable; either all controls are given spacing now, or none will. beginResize() is a method on container again. Done on GTK+ and Mac OS X for now. I'm going to go ahead and implement this on Windows in a bit, regardless of whether that Stack Overflow question get answered or not, because ugggggggggh I just want to continue working on this project for fuck's sake!
Diffstat (limited to 'redo/sizing.go')
| -rw-r--r-- | redo/sizing.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/redo/sizing.go b/redo/sizing.go index 4098f06..b828cd7 100644 --- a/redo/sizing.go +++ b/redo/sizing.go @@ -29,24 +29,20 @@ type controlSizing interface { // on GTK+ and Mac OS X, one is embedded by window and all containers; beginResize() points to a global function (TODO NOT GOOD; ideally the sizing data should be passed across size-allocate requests) type container struct { child Control - spaced bool - d *sizing } +// set to true to apply spacing to all windows +var spaced bool = false + func (c *container) resize(width, height int) { if c.child == nil { // no children; nothing to do return } - if c.d == nil { // not ready (called early or out of the proper recursive call chain (such as by the underlying system when marking an unparented Tab as shown)) - return - } - d := c.d + d := c.beginResize() allocations := c.child.allocate(0 + d.xmargin, 0 + d.ymargin, width - (2 * d.xmargin), height - (2 * d.ymargin), 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-- { allocations[i].this.commitResize(allocations[i], d) } - // always set c.d to nil so it can be garbage-collected - c.d = nil } |
