diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-25 20:47:08 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-25 20:47:08 -0400 |
| commit | c676a2d9b7996df8d76d42c47b5f376b72b08ae0 (patch) | |
| tree | 6d7346ca95c1b2b593ba30fae37d24b2c4372509 /redo/sizing.go | |
| parent | 3d5e8feba4d2980f0be647231ae0f75385afa45b (diff) | |
Implemented Tab on GTK+. I really don't like the way sizing works now...
Diffstat (limited to 'redo/sizing.go')
| -rw-r--r-- | redo/sizing.go | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/redo/sizing.go b/redo/sizing.go index 5bf1e84..0db6216 100644 --- a/redo/sizing.go +++ b/redo/sizing.go @@ -18,14 +18,6 @@ type sizingbase struct { ypadding int } -// this ensures that all *windows across all platforms contain the necessary functions -// if this fails to compile, we have a problem -var windowSizeEnsure interface { - beginResize() *sizing - endResize(*sizing) - translateAllocationCoords([]*allocation, int, int) -} = &window{} - type controlSizing interface { allocate(x int, y int, width int, height int, d *sizing) []*allocation preferredSize(*sizing) (int, int) @@ -33,8 +25,8 @@ type controlSizing interface { getAuxResizeInfo(*sizing) } -// on Windows, this is only embedded by window, as all other containers cannot have their own children -// on GTK+ and Mac OS X, one is embedded by window and all containers; the containers call container.continueResize() +// on Windows, this is only embedded by window, as all other containers cannot have their own children; beginResize() points to an instance method literal (TODO get correct term) from window +// 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 @@ -46,13 +38,6 @@ func (c *container) resize(width, height int) { return } d := c.beginResize() - c.continueResize(width, height, d) -} - -func (c *container) continueResize(width, height int, d *sizing) { - if c.child == nil { // no children; nothing to do - return - } allocations := c.child.allocate(0, 0, width, height, d) c.translateAllocationCoords(allocations, width, height) // move in reverse so as to approximate right->left order so neighbors make sense |
