diff options
| author | Pietro Gagliardi <[email protected]> | 2014-10-18 08:57:53 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-10-18 08:57:53 -0400 |
| commit | 45acb35a6d89c2e7c7d2233f3613d04253f88922 (patch) | |
| tree | f01291c519c387510ef05d7a8f0131dafebeb0a6 /newctrl/stack.go | |
| parent | 772f03f4b3d4fb45ee0359af7742effdcee8a557 (diff) | |
Fixed control positioning on GTK+. This will also "fix" control positioning on Windows; next commit.
Diffstat (limited to 'newctrl/stack.go')
| -rw-r--r-- | newctrl/stack.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/newctrl/stack.go b/newctrl/stack.go index 164d663..f210ec8 100644 --- a/newctrl/stack.go +++ b/newctrl/stack.go @@ -92,6 +92,7 @@ func (s *stack) resize(x int, y int, width int, height int, d *sizing) { 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 @@ -99,14 +100,12 @@ func (s *stack) resize(x int, y int, width int, height int, d *sizing) { xpadding = 0 ypadding = 0 } - // 0) inset the available rect by the needed padding and reset the x/y coordinates for the children + // 0) inset the available rect by the needed padding if s.orientation == horizontal { width -= (len(s.controls) - 1) * xpadding } else { height -= (len(s.controls) - 1) * ypadding } - x = 0 - y = 0 // 1) get height and width of non-stretchy controls; figure out how much space is alloted to stretchy controls stretchywid = width stretchyht = height |
