diff --git a/layouts/contract.go b/layouts/contract.go index 8550882..24d612e 100644 --- a/layouts/contract.go +++ b/layouts/contract.go @@ -42,6 +42,7 @@ func (contract Contract) MinimumSize (hints tomo.LayoutHints, boxes []tomo.Box) } func (contract Contract) Arrange (hints tomo.LayoutHints, boxes []tomo.Box) { + // TODO if we overflow in a direction, respect the reccomended size if contract.v() { dot := hints.Bounds.Min for index, box := range boxes { @@ -93,5 +94,15 @@ func (contract Contract) Arrange (hints tomo.LayoutHints, boxes []tomo.Box) { } } +func (contract Contract) RecommendedHeight (hints tomo.LayoutHints, boxes []tomo.Box, width int) int { + // TODO + return 0 +} + +func (contract Contract) RecommendedWidth (hints tomo.LayoutHints, boxes []tomo.Box, height int) int { + // TODO + return 0 +} + func (contract Contract) v () bool { return contract == ContractVertical } func (contract Contract) h () bool { return contract == ContractHorizontal } diff --git a/layouts/flow.go b/layouts/flow.go index e6acd27..c4c8d33 100644 --- a/layouts/flow.go +++ b/layouts/flow.go @@ -123,3 +123,13 @@ func (flow Flow) deltaMinor (rectangle image.Rectangle) int { func (flow Flow) fallback () tomo.Layout { return Contract(flow) } + +func (flow Flow) RecommendedHeight (hints tomo.LayoutHints, boxes []tomo.Box, width int) int { + // TODO + return 0 +} + +func (flow Flow) RecommendedWidth (hints tomo.LayoutHints, boxes []tomo.Box, height int) int { + // TODO + return 0 +} diff --git a/layouts/grid.go b/layouts/grid.go index 80f7ee9..4943a72 100644 --- a/layouts/grid.go +++ b/layouts/grid.go @@ -4,7 +4,7 @@ import "math" import "image" import "git.tebibyte.media/tomo/tomo" -var _ tomo.Layout = Grid { } +var _ tomo.Layout = new(Grid) // Grid is a layout that arranges boxes in a grid formation with distinct rows // and columns. It is great for creating forms. @@ -108,3 +108,13 @@ func expand (hints tomo.LayoutHints, sizes []int, space int, expands func (int) func ceilDiv (x, y int) int { return int(math.Ceil(float64(x) / float64(y))) } + +func (this *Grid) RecommendedHeight (hints tomo.LayoutHints, boxes []tomo.Box, width int) int { + // TODO + return 0 +} + +func (this *Grid) RecommendedWidth (hints tomo.LayoutHints, boxes []tomo.Box, height int) int { + // TODO + return 0 +}