diff options
| author | Pietro Gagliardi <[email protected]> | 2015-12-11 20:37:59 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-12-11 20:37:59 -0500 |
| commit | f8e3f12ab02b528f2a05a4f713d7af7ea8e44b42 (patch) | |
| tree | 82dedf4d37f0f6d31e88ebb2ca1ce6499dead261 /mergeback/layout.go | |
| parent | e34c561ed5bedeb180437ec165882b98d70d38c1 (diff) | |
LET'S GET THIS FINAL REWRITE EVER STARTED
Diffstat (limited to 'mergeback/layout.go')
| -rw-r--r-- | mergeback/layout.go | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/mergeback/layout.go b/mergeback/layout.go deleted file mode 100644 index e88cae4..0000000 --- a/mergeback/layout.go +++ /dev/null @@ -1,36 +0,0 @@ -package ui - -// Recursively replaces nils with stretchy empty spaces and changes the orientation -// of inner stack so they are perpenticular to each other. -func resetControls(parent *Stack) { - for i, control := range parent.controls { - switch control.(type) { - case *Stack: - stack := control.(*Stack) - stack.orientation = !parent.orientation - resetControls(stack) - case nil: - emptySpace := newStack(horizontal) - parent.controls[i] = emptySpace - parent.stretchy[i] = true - } - } -} - -// Creates a new Stack from the given controls. The topmost Stack will have -// vertical orientation and margin borders, with each nested stack being -// oriented oppositely. Controls are displayed with a default padding -// between them. -func Layout(controls ...Control) *Stack { - stack := &Stack{ - orientation: vertical, - controls: controls, - stretchy: make([]bool, len(controls)), - width: make([]int, len(controls)), - height: make([]int, len(controls)), - } - - resetControls(stack) - - return stack -} |
