mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 12:55:47 +02:00
WIP Add Padding field to boxlayout.Box
This commit is contained in:
parent
c08a5fe4e7
commit
c26a9218a1
1 changed files with 5 additions and 1 deletions
6
vendor/github.com/jesseduffield/lazycore/pkg/boxlayout/boxlayout.go
generated
vendored
6
vendor/github.com/jesseduffield/lazycore/pkg/boxlayout/boxlayout.go
generated
vendored
|
@ -50,6 +50,9 @@ type Box struct {
|
||||||
// dynamic size. Once all statically sized children have been considered, Weight decides how much of the remaining space will be taken up by the box
|
// dynamic size. Once all statically sized children have been considered, Weight decides how much of the remaining space will be taken up by the box
|
||||||
// TODO: consider making there be one int and a type enum so we can't have size and Weight simultaneously defined
|
// TODO: consider making there be one int and a type enum so we can't have size and Weight simultaneously defined
|
||||||
Weight int
|
Weight int
|
||||||
|
|
||||||
|
// Padding between children
|
||||||
|
Padding int
|
||||||
}
|
}
|
||||||
|
|
||||||
func ArrangeWindows(root *Box, x0, y0, width, height int) map[string]Dimensions {
|
func ArrangeWindows(root *Box, x0, y0, width, height int) map[string]Dimensions {
|
||||||
|
@ -71,6 +74,7 @@ func ArrangeWindows(root *Box, x0, y0, width, height int) map[string]Dimensions
|
||||||
} else {
|
} else {
|
||||||
availableSize = height
|
availableSize = height
|
||||||
}
|
}
|
||||||
|
availableSize -= (len(children) - 1) * root.Padding
|
||||||
|
|
||||||
sizes := calcSizes(children, availableSize)
|
sizes := calcSizes(children, availableSize)
|
||||||
|
|
||||||
|
@ -87,7 +91,7 @@ func ArrangeWindows(root *Box, x0, y0, width, height int) map[string]Dimensions
|
||||||
}
|
}
|
||||||
|
|
||||||
result = mergeDimensionMaps(result, resultForChild)
|
result = mergeDimensionMaps(result, resultForChild)
|
||||||
offset += boxSize
|
offset += boxSize + (i+1)*root.Padding
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue