+ if n.view.LockWidth {
+ lockedWidth += n.view.Width
+ lockedChildren++
+ }
+ } else {
+ if n.view.LockHeight {
+ lockedHeight += n.view.Height
+ lockedChildren++
+ }
+ }
+ } else if n, ok := node.(*SplitTree); ok {
+ if s.kind == VerticalSplit {
+ if n.lockWidth {
+ lockedWidth += n.width
+ lockedChildren++
+ }
+ } else {
+ if n.lockHeight {
+ lockedHeight += n.height
+ lockedChildren++
+ }
+ }
+ }
+ }
+ x, y := 0, 0
+ for _, node := range s.children {
+ if n, ok := node.(*LeafNode); ok {
+ if s.kind == VerticalSplit {
+ if !n.view.LockWidth {
+ n.view.Width = (s.width - lockedWidth) / (len(s.children) - lockedChildren)
+ }
+ n.view.Height = s.height