From 45acb35a6d89c2e7c7d2233f3613d04253f88922 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 18 Oct 2014 08:57:53 -0400 Subject: Fixed control positioning on GTK+. This will also "fix" control positioning on Windows; next commit. --- newctrl/stack.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'newctrl/stack.go') 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 -- cgit v1.2.3