summaryrefslogtreecommitdiff
path: root/redo/sizing.go
diff options
context:
space:
mode:
Diffstat (limited to 'redo/sizing.go')
-rw-r--r--redo/sizing.go12
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
}